- java.lang.Object
-
- java.lang.Enum<CircuitBreaker.State>
-
- io.helidon.faulttolerance.CircuitBreaker.State
-
- All Implemented Interfaces:
Serializable,Comparable<CircuitBreaker.State>
- Enclosing interface:
- CircuitBreaker
public static enum CircuitBreaker.State extends Enum<CircuitBreaker.State>
A circuit breaker can be in any of 3 possible states as defined by this enum. TheCLOSEDstate is the normal one; anOPENstate indicates the circuit breaker is blocking requests andHALF_OPENthat a circuit breaker is transitioning to aCLOSEDstate provided enough successful requests are observed.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CLOSEDCircuit is closed and requests are processed.HALF_OPENCircuit is half open and some test requests are processed, others fail withCircuitBreakerOpenException.OPENCircuit is open and all requests fail withCircuitBreakerOpenException.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static CircuitBreaker.StatevalueOf(String name)Returns the enum constant of this type with the specified name.static CircuitBreaker.State[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
CLOSED
public static final CircuitBreaker.State CLOSED
Circuit is closed and requests are processed.
-
HALF_OPEN
public static final CircuitBreaker.State HALF_OPEN
Circuit is half open and some test requests are processed, others fail withCircuitBreakerOpenException.
-
OPEN
public static final CircuitBreaker.State OPEN
Circuit is open and all requests fail withCircuitBreakerOpenException.
-
-
Method Detail
-
values
public static CircuitBreaker.State[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (CircuitBreaker.State c : CircuitBreaker.State.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static CircuitBreaker.State valueOf(String name)
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
-
-