| Modifier and Type | Class and Description |
|---|---|
| private class | |
| private static interface | |
| private class | |
| private class | |
| private class | |
| private class | |
| private class | |
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private final CircuitBreakerConfig | |
| private final Clock | |
| private final Function | |
| private final CircuitBreakerStateMachine. | |
| private final ReentrantLock | |
| private static final Logger | |
| private final String | |
| private final SchedulerFactory | |
| private final AtomicReference | |
| private final Map | |
| private final TimeUnit |
| Access | Constructor and Description |
|---|---|
| private | CircuitBreakerStateMachine(String
the name of the CircuitBreaker name, CircuitBreakerConfig The CircuitBreaker configuration. circuitBreakerConfig, SchedulerFactory A SchedulerFactory which can be mocked in tests. schedulerFactory, Map<String, String> tags)Creates a circuitBreaker. |
| public | CircuitBreakerStateMachine(String
the name of the CircuitBreaker name, CircuitBreakerConfig The CircuitBreaker configuration. circuitBreakerConfig, SchedulerFactory A SchedulerFactory which can be mocked in tests. schedulerFactory)Creates a circuitBreaker. |
| public | CircuitBreakerStateMachine(String
the name of the CircuitBreaker name, CircuitBreakerConfig The CircuitBreaker configuration. circuitBreakerConfig)Creates a circuitBreaker. |
| public | CircuitBreakerStateMachine(String
the name of the CircuitBreaker name, CircuitBreakerConfig The CircuitBreaker configuration. circuitBreakerConfig, Map<String, String> tags)Creates a circuitBreaker. |
| public | CircuitBreakerStateMachine(String
the name of the CircuitBreaker name)Creates a circuitBreaker with default config. |
| public | CircuitBreakerStateMachine(String
the name of the CircuitBreaker name, Supplier<CircuitBreakerConfig> The CircuitBreaker configuration supplier. circuitBreakerConfig)Creates a circuitBreaker. |
| public | CircuitBreakerStateMachine(String
the name of the CircuitBreaker name, Supplier<CircuitBreakerConfig> The CircuitBreaker configuration supplier. circuitBreakerConfig, Map<String, String> tags)Creates a circuitBreaker. |
| Modifier and Type | Method and Description |
|---|---|
| public void | acquirePermission()
Implements io. Try to obtain a permission to execute a call. |
| private Duration | |
| public CircuitBreakerConfig | Returns: the config of this CircuitBreakerImplements io. Get the config of this CircuitBreaker. |
| public long | getCurrentTimestamp()
Implements io. Returns the current time with respect to the CircuitBreaker currentTimeFunction. |
| public CircuitBreaker. | getEventPublisher()
Implements io. Returns an EventPublisher which can be used to register event consumers. |
| public CircuitBreaker. | getMetrics()
Implements io. Returns the Metrics of this CircuitBreaker. |
| public String | Returns: the name of this CircuitBreakerImplements io. Get the name of this CircuitBreaker. |
| public CircuitBreaker. | Returns: the state of this CircuitBreakerImplements io. Get the state of this CircuitBreaker. |
| public Map | getTags()
Implements io. Returns an unmodifiable map with tags assigned to this CircuitBreaker. |
| public TimeUnit | getTimestampUnit()
Implements io. Returns the timeUnit of current timestamp. |
| private void | |
| private void | |
| 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 io. 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 io. 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 io. Records a successful call. |
| private void | |
| private void | publishCircuitErrorEvent(final String name, final long duration, final TimeUnit durationUnit, final Throwable throwable)
|
| private void | |
| private void | publishCircuitIgnoredErrorEvent(final String name, long duration, final TimeUnit durationUnit, final Throwable throwable)
|
| private void | |
| private void | publishCircuitThresholdsExceededEvent(final CircuitBreakerMetrics.
|
| private void | |
| private void | |
| private void | |
| private void | |
| private void | |
| public void | releasePermission()
Implements io. Releases a permission. |
| public void | reset()
Implements io. Returns the circuit breaker to its original closed state, losing statistics. |
| private boolean | |
| private void | stateTransition(CircuitBreaker.
|
| public String | |
| public void | transitionToClosedState()
Implements io. Transitions the state machine to CLOSED state. |
| public void | transitionToDisabledState()
Implements io. Transitions the state machine to a DISABLED state, stopping state transition, metrics and event publishing. |
| public void | transitionToForcedOpenState()
Implements io. Transitions the state machine to a FORCED_OPEN state, stopping state transition, metrics and event publishing. |
| public void | transitionToHalfOpenState()
Implements io. Transitions the state machine to HALF_OPEN state. |
| public void | transitionToMetricsOnlyState()
Implements io. Transitions the state machine to METRICS_ONLY state, stopping all state transitions but continues to capture metrics and publish events. |
| public void | transitionToOpenState()
Implements io. Transitions the state machine to OPEN state. |
| public void | transitionToOpenStateFor(Duration
how long should we wait in open state waitDuration)Implements io. Same as |
| public void | transitionToOpenStateUntil(Instant
how long should we wait in open state waitUntil)Implements io. Same as |
| public boolean | tryAcquirePermission()
Implements io. Acquires a permission to execute a call, only if one is available at the time of invocation. |