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 class EventCountCircuitBreaker.StateStrategyClosed extends EventCountCircuitBreaker.StateStrategy
A specializedStateStrategy
implementation for the state closed.
-
-
Constructor Summary
Constructors Modifier Constructor Description private
StateStrategyClosed()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected long
fetchCheckInterval(EventCountCircuitBreaker breaker)
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 specifiedCheckIntervalData
objects indicate that a state transition should occur.-
Methods inherited from class org.apache.commons.lang3.concurrent.EventCountCircuitBreaker.StateStrategy
isCheckIntervalFinished
-
-
-
-
Method Detail
-
isStateTransition
public boolean isStateTransition(EventCountCircuitBreaker breaker, EventCountCircuitBreaker.CheckIntervalData currentData, EventCountCircuitBreaker.CheckIntervalData nextData)
Checks whether the specifiedCheckIntervalData
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 currentCheckIntervalData
objectnextData
- the updatedCheckIntervalData
object- Returns:
- a flag whether a state transition should be performed
-
fetchCheckInterval
protected long fetchCheckInterval(EventCountCircuitBreaker breaker)
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
-
-