public static enum CircuitBreaker.State extends Enum<CircuitBreaker.State>
| Enum Constant and Description |
|---|
CLOSED
In
CLOSED state, all requests are permitted. |
HALF_OPEN
In
HALF_OPEN state, the circuit breaker will allow a "probe" invocation. |
OPEN
In
OPEN state, all requests will be rejected until the next recovery time point. |
| Modifier and Type | Method and Description |
|---|---|
static CircuitBreaker.State |
valueOf(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.
|
public static final CircuitBreaker.State OPEN
OPEN state, all requests will be rejected until the next recovery time point.public static final CircuitBreaker.State HALF_OPEN
HALF_OPEN state, the circuit breaker will allow a "probe" invocation.
If the invocation is abnormal according to the strategy (e.g. it's slow), the circuit breaker
will re-transform to the OPEN state and wait for the next recovery time point;
otherwise the resource will be regarded as "recovered" and the circuit breaker
will cease cutting off requests and transform to CLOSED state.public static final CircuitBreaker.State CLOSED
CLOSED state, all requests are permitted. When current metric value exceeds the threshold,
the circuit breaker will transform to OPEN state.public static CircuitBreaker.State[] values()
for (CircuitBreaker.State c : CircuitBreaker.State.values()) System.out.println(c);
public static CircuitBreaker.State valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullCopyright © 2021 Alibaba Group. All rights reserved.