Class EventCountCircuitBreaker.StateStrategyClosed
java.lang.Object
org.apache.commons.lang3.concurrent.EventCountCircuitBreaker.StateStrategy
org.apache.commons.lang3.concurrent.EventCountCircuitBreaker.StateStrategyClosed
- Enclosing class:
EventCountCircuitBreaker
private static final class EventCountCircuitBreaker.StateStrategyClosed
extends EventCountCircuitBreaker.StateStrategy
A specialized
EventCountCircuitBreaker.StateStrategy implementation for the state closed.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected longObtains the check interval to applied for the represented state from the givenCircuitBreaker.booleanisStateTransition(EventCountCircuitBreaker breaker, EventCountCircuitBreaker.CheckIntervalData currentData, EventCountCircuitBreaker.CheckIntervalData nextData) Checks whether the specifiedEventCountCircuitBreaker.CheckIntervalDataobjects indicate that a state transition should occur.Methods inherited from class org.apache.commons.lang3.concurrent.EventCountCircuitBreaker.StateStrategy
isCheckIntervalFinished
-
Constructor Details
-
StateStrategyClosed
private StateStrategyClosed()
-
-
Method Details
-
fetchCheckInterval
Obtains the check interval to applied for the represented state from the givenCircuitBreaker.- Specified by:
fetchCheckIntervalin classEventCountCircuitBreaker.StateStrategy- Parameters:
breaker- theCircuitBreaker- Returns:
- the check interval to be applied
-
isStateTransition
public boolean isStateTransition(EventCountCircuitBreaker breaker, EventCountCircuitBreaker.CheckIntervalData currentData, EventCountCircuitBreaker.CheckIntervalData nextData) Checks whether the specifiedEventCountCircuitBreaker.CheckIntervalDataobjects indicate that a state transition should occur. Here the logic which checks for thresholds depending on the current state is implemented.- Specified by:
isStateTransitionin classEventCountCircuitBreaker.StateStrategy- Parameters:
breaker- theCircuitBreakercurrentData- the currentEventCountCircuitBreaker.CheckIntervalDataobjectnextData- the updatedEventCountCircuitBreaker.CheckIntervalDataobject- Returns:
- a flag whether a state transition should be performed
-