private abstract static class EventCountCircuitBreaker.StateStrategy
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
private |
StateStrategy() |
Modifier and Type | Method and Description |
---|---|
protected abstract long |
fetchCheckInterval(EventCountCircuitBreaker breaker)
Obtains the check interval to applied for the represented state from the given
CircuitBreaker . |
boolean |
isCheckIntervalFinished(EventCountCircuitBreaker breaker,
EventCountCircuitBreaker.CheckIntervalData currentData,
long now)
Returns a flag whether the end of the current check interval is reached.
|
abstract boolean |
isStateTransition(EventCountCircuitBreaker breaker,
EventCountCircuitBreaker.CheckIntervalData currentData,
EventCountCircuitBreaker.CheckIntervalData nextData)
Checks whether the specified
CheckIntervalData objects indicate that a
state transition should occur. |
public boolean isCheckIntervalFinished(EventCountCircuitBreaker breaker, EventCountCircuitBreaker.CheckIntervalData currentData, long now)
breaker
- the CircuitBreaker
currentData
- the current state objectnow
- the current timepublic abstract boolean isStateTransition(EventCountCircuitBreaker breaker, EventCountCircuitBreaker.CheckIntervalData currentData, EventCountCircuitBreaker.CheckIntervalData nextData)
CheckIntervalData
objects indicate that a
state transition should occur. Here the logic which checks for thresholds
depending on the current state is implemented.breaker
- the CircuitBreaker
currentData
- the current CheckIntervalData
objectnextData
- the updated CheckIntervalData
objectprotected abstract long fetchCheckInterval(EventCountCircuitBreaker breaker)
CircuitBreaker
.breaker
- the CircuitBreaker