Class EventCountCircuitBreaker.StateStrategyOpen
java.lang.Object
org.apache.commons.lang3.concurrent.EventCountCircuitBreaker.StateStrategy
org.apache.commons.lang3.concurrent.EventCountCircuitBreaker.StateStrategyOpen
- Enclosing class:
EventCountCircuitBreaker
private static final class EventCountCircuitBreaker.StateStrategyOpen
extends EventCountCircuitBreaker.StateStrategy
A specialized
EventCountCircuitBreaker.StateStrategy
implementation for the state open.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected long
Obtains the check interval to applied for the represented state from the givenCircuitBreaker
.boolean
isStateTransition
(EventCountCircuitBreaker breaker, EventCountCircuitBreaker.CheckIntervalData currentData, EventCountCircuitBreaker.CheckIntervalData nextData) Checks whether the specifiedEventCountCircuitBreaker.CheckIntervalData
objects indicate that a state transition should occur.Methods inherited from class org.apache.commons.lang3.concurrent.EventCountCircuitBreaker.StateStrategy
isCheckIntervalFinished
-
Constructor Details
-
StateStrategyOpen
private StateStrategyOpen()
-
-
Method Details
-
fetchCheckInterval
Obtains the check interval to applied for the represented state from the givenCircuitBreaker
.- Specified by:
fetchCheckInterval
in 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.CheckIntervalData
objects indicate that a state transition should occur. Here the logic which checks for thresholds depending on the current state is implemented.- Specified by:
isStateTransition
in classEventCountCircuitBreaker.StateStrategy
- Parameters:
breaker
- theCircuitBreaker
currentData
- the currentEventCountCircuitBreaker.CheckIntervalData
objectnextData
- the updatedEventCountCircuitBreaker.CheckIntervalData
object- Returns:
- a flag whether a state transition should be performed
-