Package dev.failsafe.internal
Class HalfOpenState<R>
java.lang.Object
dev.failsafe.internal.CircuitState<R>
dev.failsafe.internal.HalfOpenState<R>
-
Field Summary
FieldsFields inherited from class dev.failsafe.internal.CircuitState
breaker, config, stats -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static intcapacityFor(CircuitBreaker<?> breaker) Returns the capacity of the breaker in the half-open state.(package private) voidcheckThreshold(ExecutionContext<R> context) Checks to determine if a threshold has been met and the circuit should be opened or closed.getState()voidvoidbooleanMethods inherited from class dev.failsafe.internal.CircuitState
getRemainingDelay, getStats, recordFailure, recordSuccess
-
Field Details
-
permittedExecutions
-
-
Constructor Details
-
HalfOpenState
-
-
Method Details
-
tryAcquirePermit
public boolean tryAcquirePermit()- Specified by:
tryAcquirePermitin classCircuitState<R>
-
releasePermit
public void releasePermit()- Overrides:
releasePermitin classCircuitState<R>
-
getState
- Specified by:
getStatein classCircuitState<R>
-
handleConfigChange
public void handleConfigChange()- Overrides:
handleConfigChangein classCircuitState<R>
-
checkThreshold
Checks to determine if a threshold has been met and the circuit should be opened or closed.If a success threshold is configured, the circuit is opened or closed based on whether the ratio was exceeded.
Else the circuit is opened or closed based on whether the failure threshold was exceeded.
- Overrides:
checkThresholdin classCircuitState<R>
-
capacityFor
Returns the capacity of the breaker in the half-open state.
-