| Modifier and Type | Class and Description |
|---|---|
| public static class |
| Modifier and Type | Field and Description |
|---|---|
| private Deque | |
| private static final Logger | |
| private final int | |
| private volatile long | |
| private final CircuitBreaker |
| Access | Constructor and Description |
|---|---|
| public | |
| public | OciCircuitBreakerImpl(CircuitBreakerConfiguration circuitBreakerConfiguration, Predicate<Throwable> recordExceptionPredicate)
|
| Modifier and Type | Method and Description |
|---|---|
| public void | acquirePermission()
Implements com. Try to obtain a permission to execute a call. |
| public synchronized void | addToHistory(Throwable throwable, Integer status, Map<String, String> messages)
Implements com.
|
| public String | Returns: a message with error detailsthe request URI, or null if not known requestUri)Implements com. Generates CircuitBreaker message when it's open. |
| public CallNotAllowedException | |
| public boolean | equals(Object
the reference object with which to compare. o)Overrides java. Indicates whether some other object is "equal to" this one. |
| public OciCircuitBreaker. | getCircuitBreakerConfig()
Implements com. Returns the CircuitBreakerConfig of this CircuitBreaker. |
| private long | Returns: time since last opening in millisecondsReturns the time in milliseconds since the last opening of the circuit breaker. |
| public long | getCurrentTimestamp()
Implements com. Returns the current time with respect to the CircuitBreaker currentTimeFunction. |
| public synchronized List | |
| public synchronized String | |
| public String | getName()
Implements com. Returns the name of this CircuitBreaker. |
| public CircuitBreaker | |
| public CircuitBreaker. | getState()
Implements com. Returns the state of this CircuitBreaker. |
| public TimeUnit | getTimestampUnit()
Implements com. Returns the timeUnit of current timestamp. |
| public int | |
| public void | onError(long
The elapsed time duration of the call duration, TimeUnit The duration unit durationUnit, Throwable The throwable which must be recorded throwable)Implements com. Records a failed call. |
| public void | onResult(long
The elapsed time duration of the call duration, TimeUnit The duration unit durationUnit, Object The result of the protected function result)Implements com. This method must be invoked when a call returned a result and the result predicate should decide if the call was successful or not. |
| public void | onSuccess(long
The elapsed time duration of the call duration, TimeUnit The duration unit durationUnit)Implements com. Records a successful call. |
| public void | releasePermission()
Implements com. Releases a permission. |
| public String | |
| public boolean | tryAcquirePermission()
Implements com. Acquires a permission to execute a call, only if one is available at the time of invocation. |
| historyQueue | back to summary |
|---|---|
| private Deque<OciCircuitBreaker. | |
| LOG | back to summary |
|---|---|
| private static final Logger LOG | |
| numberOfRecordedHistoryResponses | back to summary |
|---|---|
| private final int numberOfRecordedHistoryResponses | |
| openedTimestampMillis | back to summary |
|---|---|
| private volatile long openedTimestampMillis | |
| r4jCircuitBreaker | back to summary |
|---|---|
| private final CircuitBreaker r4jCircuitBreaker | |
| OciCircuitBreakerImpl | back to summary |
|---|---|
| public OciCircuitBreakerImpl(CircuitBreaker r4jCircuitBreaker, int numberOfRecordedHistoryResponses) | |
| OciCircuitBreakerImpl | back to summary |
|---|---|
| public OciCircuitBreakerImpl(CircuitBreakerConfiguration circuitBreakerConfiguration, Predicate<Throwable> recordExceptionPredicate) | |
| acquirePermission | back to summary |
|---|---|
| public void acquirePermission() Implements com. Doc from com. Try to obtain a permission to execute a call. If a call is not permitted, the number of not permitted calls is increased. Throws a CallNotPermittedException when the state is OPEN or FORCED_OPEN. Returns when the state is CLOSED or DISABLED. Returns when the state is HALF_OPEN and further test calls are allowed. Throws a CallNotPermittedException when the state is HALF_OPEN and the number of test calls has been reached. If the state is HALF_OPEN, the number of allowed test calls is decreased. Important Note Make sure to call onSuccess or onError after the call is finished. If the call is cancelled before it is invoked, you have to release the permission again.
| |
| addToHistory | back to summary |
|---|---|
| public synchronized void addToHistory(Throwable throwable, Integer status, Map<String, String> messages) Implements com.
| |
| circuitBreakerCallNotPermittedErrorMessage | back to summary |
|---|---|
| public String circuitBreakerCallNotPermittedErrorMessage(String requestUri) Implements com. Generates CircuitBreaker message when it's open. | |
| createCallNotAllowedException | back to summary |
|---|---|
| public CallNotAllowedException createCallNotAllowedException() Implements com.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| getCircuitBreakerConfig | back to summary |
|---|---|
| public OciCircuitBreaker. Implements com. Doc from com. Returns the CircuitBreakerConfig of this CircuitBreaker.
| |
| getCircuitBreakerOpenTime | back to summary |
|---|---|
| private long getCircuitBreakerOpenTime() Returns the time in milliseconds since the last opening of the circuit breaker. If the
circuit breaker has never been opened, then
| |
| getCurrentTimestamp | back to summary |
|---|---|
| public long getCurrentTimestamp() Implements com. Doc from com. Returns the current time with respect to the CircuitBreaker currentTimeFunction. Returns System.nanoTime() by default.
| |
| getHistory | back to summary |
|---|---|
| public synchronized List Implements com.
| |
| getHistoryAsString | back to summary |
|---|---|
| public synchronized String getHistoryAsString() Implements com.
| |
| getName | back to summary |
|---|---|
| public String getName() Implements com. Doc from com. Returns the name of this CircuitBreaker. | |
| getR4jCircuitBreaker | back to summary |
|---|---|
| public CircuitBreaker getR4jCircuitBreaker() Implements com.
| |
| getState | back to summary |
|---|---|
| public CircuitBreaker. Implements com. Doc from com. Returns the state of this CircuitBreaker.
| |
| getTimestampUnit | back to summary |
|---|---|
| public TimeUnit getTimestampUnit() Implements com. Doc from com. Returns the timeUnit of current timestamp. Default is TimeUnit.NANOSECONDS. | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| onError | back to summary |
|---|---|
| public void onError(long duration, TimeUnit durationUnit, Throwable throwable) Implements com. Doc from com. Records a failed call. This method must be invoked when a call failed. | |
| onResult | back to summary |
|---|---|
| public void onResult(long duration, TimeUnit durationUnit, Object result) Implements com. Doc from com. This method must be invoked when a call returned a result and the result predicate should decide if the call was successful or not. | |
| onSuccess | back to summary |
|---|---|
| public void onSuccess(long duration, TimeUnit durationUnit) Implements com. Doc from com. Records a successful call. This method must be invoked when a call was successful. | |
| releasePermission | back to summary |
|---|---|
| public void releasePermission() Implements com. Doc from com. Releases a permission. Should only be used when a permission was acquired but not used. Otherwise use If the state is HALF_OPEN, the number of allowed test calls is increased by one.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| tryAcquirePermission | back to summary |
|---|---|
| public boolean tryAcquirePermission() Implements com. Doc from com. Acquires a permission to execute a call, only if one is available at the time of invocation. If a call is not permitted, the number of not permitted calls is increased. Returns false when the state is OPEN or FORCED_OPEN. Returns true when the state is CLOSED or DISABLED. Returns true when the state is HALF_OPEN and further test calls are allowed. Returns false when the state is HALF_OPEN and the number of test calls has been reached. If the state is HALF_OPEN, the number of allowed test calls is decreased. Important Note Make sure to call onSuccess or onError after the call is finished. If the call is cancelled before it is invoked, you have to release the permission again.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final CircuitBreakerConfig |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object
the reference object with which to compare. o)Overrides java. Indicates whether some other object is "equal to" this one. |
| public Function | |
| public float | |
| public Predicate | |
| public Duration | |
| public int | |
| public int | |
| public Predicate | |
| public Predicate | |
| public int | |
| public OciCircuitBreaker. | |
| public Duration | |
| public float | |
| public TimeUnit | |
| public OciCircuitBreaker. | |
| public int | |
| public boolean | |
| public boolean | |
| public String |
| r4jConfig | back to summary |
|---|---|
| private final CircuitBreakerConfig r4jConfig | |
| OciCircuitBreakerConfigImpl | back to summary |
|---|---|
| public OciCircuitBreakerConfigImpl(CircuitBreakerConfig r4jConfig) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| getCurrentTimestampFunction | back to summary |
|---|---|
| public Function | |
| getFailureRateThreshold | back to summary |
|---|---|
| public float getFailureRateThreshold() Implements com.
| |
| getIgnoreExceptionPredicate | back to summary |
|---|---|
| public Predicate | |
| getMaxWaitDurationInHalfOpenState | back to summary |
|---|---|
| public Duration getMaxWaitDurationInHalfOpenState() | |
| getMinimumNumberOfCalls | back to summary |
|---|---|
| public int getMinimumNumberOfCalls() Implements com.
| |
| getPermittedNumberOfCallsInHalfOpenState | back to summary |
|---|---|
| public int getPermittedNumberOfCallsInHalfOpenState() Implements com.
| |
| getRecordExceptionPredicate | back to summary |
|---|---|
| public Predicate Implements com.
| |
| getRecordResultPredicate | back to summary |
|---|---|
| public Predicate | |
| getSlidingWindowSize | back to summary |
|---|---|
| public int getSlidingWindowSize() Implements com.
| |
| getSlidingWindowType | back to summary |
|---|---|
| public OciCircuitBreaker. Implements com.
| |
| getSlowCallDurationThreshold | back to summary |
|---|---|
| public Duration getSlowCallDurationThreshold() Implements com.
| |
| getSlowCallRateThreshold | back to summary |
|---|---|
| public float getSlowCallRateThreshold() Implements com.
| |
| getTimestampUnit | back to summary |
|---|---|
| public TimeUnit getTimestampUnit() | |
| getWaitIntervalFunctionInOpenState | back to summary |
|---|---|
| public OciCircuitBreaker. | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| isAutomaticTransitionFromOpenToHalfOpenEnabled | back to summary |
|---|---|
| public boolean isAutomaticTransitionFromOpenToHalfOpenEnabled() | |
| isWritableStackTraceEnabled | back to summary |
|---|---|
| public boolean isWritableStackTraceEnabled() Implements com.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |