Enum Class CircuitState

java.lang.Object
java.lang.Enum<CircuitState>
com.linecorp.armeria.client.circuitbreaker.CircuitState
All Implemented Interfaces:
Serializable, Comparable<CircuitState>, Constable

public enum CircuitState extends Enum<CircuitState>
Defines the states of circuit breaker.
  • Enum Constant Details

    • CLOSED

      public static final CircuitState CLOSED
      Initial state. All requests are sent to the remote service.
    • OPEN

      public static final CircuitState OPEN
      The circuit is tripped. All requests fail immediately without calling the remote service.
    • HALF_OPEN

      public static final CircuitState HALF_OPEN
      Only one trial request is sent at a time until at least one request succeeds or fails. If it doesn't complete within a certain time, another trial request will be sent again. All other requests fails immediately same as OPEN.
    • FORCED_OPEN

      public static final CircuitState FORCED_OPEN
      The circuit is tripped. All requests fail immediately without calling the remote service. State transition will not occur from this state unless explicitly changed by the user via CircuitBreaker.enterState(CircuitState).
  • Method Details

    • values

      public static CircuitState[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static CircuitState valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null