Enum CircuitBreakerState
- All Implemented Interfaces:
Serializable, Comparable<CircuitBreakerState>
Circuit breaker states.
- Author:
- Clement Escoffier
-
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic CircuitBreakerStateReturns the enum constant of this type with the specified name.static CircuitBreakerState[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
OPEN
TheOPENstate. The circuit breaker is executing the fallback, and switches to theHALF_OPENstate after the specified time. -
CLOSED
TheCLOSEDstate. The circuit breaker lets invocations pass and collects the failures. If the number of failures reach the specified threshold, the circuit breaker switches to theOPENstate. -
HALF_OPEN
TheHALF_OPENstate. The circuit breaker has been opened, and is now checking the current situation. It lets the next invocation pass and determines from the result (failure or success) if the circuit breaker can be switched to theCLOSEDstate again.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-