Package dev.failsafe.internal
Class ClosedState<R>
- java.lang.Object
-
- dev.failsafe.internal.CircuitState<R>
-
- dev.failsafe.internal.ClosedState<R>
-
class ClosedState<R> extends CircuitState<R>
-
-
Field Summary
-
Fields inherited from class dev.failsafe.internal.CircuitState
breaker, config, stats
-
-
Constructor Summary
Constructors Constructor Description ClosedState(CircuitBreakerImpl<R> breaker)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static intcapacityFor(CircuitBreaker<?> breaker)Returns the capacity of the breaker in the closed state.(package private) voidcheckThreshold(ExecutionContext<R> context)Checks to see if the executions and failure thresholds have been exceeded, opening the circuit if so.CircuitBreaker.StategetState()voidhandleConfigChange()booleantryAcquirePermit()-
Methods inherited from class dev.failsafe.internal.CircuitState
getRemainingDelay, getStats, recordFailure, recordSuccess, releasePermit
-
-
-
-
Constructor Detail
-
ClosedState
public ClosedState(CircuitBreakerImpl<R> breaker)
-
-
Method Detail
-
tryAcquirePermit
public boolean tryAcquirePermit()
- Specified by:
tryAcquirePermitin classCircuitState<R>
-
getState
public CircuitBreaker.State getState()
- Specified by:
getStatein classCircuitState<R>
-
handleConfigChange
public void handleConfigChange()
- Overrides:
handleConfigChangein classCircuitState<R>
-
checkThreshold
void checkThreshold(ExecutionContext<R> context)
Checks to see if the executions and failure thresholds have been exceeded, opening the circuit if so.- Overrides:
checkThresholdin classCircuitState<R>
-
capacityFor
private static int capacityFor(CircuitBreaker<?> breaker)
Returns the capacity of the breaker in the closed state.
-
-