io.vertx.circuitbreaker

## Enum CircuitBreakerState

- java.lang.Object
- - java.lang.Enum<CircuitBreakerState>
  - - io.vertx.circuitbreaker.CircuitBreakerState

- All Implemented Interfaces:
    Serializable, Comparable<CircuitBreakerState>

      public enum CircuitBreakerState
      extends Enum<CircuitBreakerState>

  Circuit breaker states.
  Author:
    Clement Escoffier

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `CLOSED` The `CLOSED` state.
    `HALF_OPEN` The `HALF_OPEN` state.
    `OPEN` The `OPEN` state.

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static CircuitBreakerState` | `valueOf(String name)` Returns 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.

    - ### Methods inherited from class java.lang.Enum

      `clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Enum Constant Detail

    - #### OPEN

          public static final CircuitBreakerState OPEN

      The `OPEN` state. The circuit breaker is executing the fallback, and switches to the `HALF_OPEN` state after the specified time.

    - #### CLOSED

          public static final CircuitBreakerState CLOSED

      The `CLOSED` state. The circuit breaker lets invocations pass and collects the failures. IF the number of failures reach the specified threshold, the cricuit breaker switches to the `OPEN` state.

    - #### HALF_OPEN

          public static final CircuitBreakerState HALF_OPEN

      The `HALF_OPEN` state. The circuit breaker has been opened, and is now checking the current situation. It lets pass the next invocation and determines from the result (failure or success) if the circuit breaker can be switched to the `CLOSED` state again.

  - ### Method Detail

    - #### values

          public static CircuitBreakerState[] 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 (CircuitBreakerState c : CircuitBreakerState.values())
              System.out.println(c);

      Returns:
        an array containing the constants of this enum type, in the order they are declared

    - #### valueOf

          public static CircuitBreakerState 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 name
        `NullPointerException` - if the argument is null

Copyright © 2020 Eclipse. All rights reserved.