public class CircuitBreakerState extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
CircuitBreakerState.CircuitState |
| Constructor and Description |
|---|
CircuitBreakerState(int requestVolumeThreshold) |
| Modifier and Type | Method and Description |
|---|---|
CircuitBreakerState.CircuitState |
getCircuitState()
Gets the current circuit state.
|
int |
getHalfOpenSuccessFulResultCounter()
Gets the successful results counter for the half open state.
|
void |
incrementHalfOpenSuccessfulResultCounter()
Increments the successful results counter for the half open state.
|
Boolean |
isOverFailureThreshold(long failureThreshold)
Checks to see if the CircuitBreaker is over the given failure threshold.
|
void |
recordClosedResult(Boolean result)
Records a success or failure result to the CircuitBreaker.
|
void |
resetHalfOpenSuccessfulResultCounter()
Resets the successful results counter for the half open state.
|
void |
resetResults()
Clears the results queue.
|
void |
setCircuitState(CircuitBreakerState.CircuitState circuitState)
Sets the CircuitBreaker state to the provided enum value.
|
public CircuitBreakerState.CircuitState getCircuitState()
public void setCircuitState(CircuitBreakerState.CircuitState circuitState)
circuitState - The state to set the CIrcuitBreaker to.public void recordClosedResult(Boolean result)
result - True for a success, false for a failurepublic void resetResults()
public void incrementHalfOpenSuccessfulResultCounter()
public void resetHalfOpenSuccessfulResultCounter()
public int getHalfOpenSuccessFulResultCounter()
public Boolean isOverFailureThreshold(long failureThreshold)
failureThreshold - The number of failures before the circuit breaker should openCopyright © 2018. All rights reserved.