Enum LifecycleState

  • All Implemented Interfaces:
    Serializable, Comparable<LifecycleState>

    public enum LifecycleState
    extends Enum<LifecycleState>
    **Represents common lifecycle states of components.**

    The LifecycleStates are usually combined with the AbstractStateMachine to build up a state-machine like, observable component that can be subscribed from external components.

         [*] --> Disconnected
         Disconnected --> Connecting
         Connecting --> Disconnected
         Connecting --> Connected
         Connecting --> Degraded
         Connected --> Disconnecting
         Connected --> Degraded
         Degraded --> Connected
         Disconnecting -> Disconnected
    Michael Nitschinger
    • Enum Constant Detail


        public static final LifecycleState DISCONNECTED
        The component is currently disconnected.

        public static final LifecycleState CONNECTING
        The component is currently connecting or reconnecting.

        public static final LifecycleState CONNECTED
        The component is connected without degradation.

        public static final LifecycleState DISCONNECTING
        The component is disconnecting.
      • DEGRADED

        public static final LifecycleState DEGRADED
        The component is connected, but with service degradation.
      • IDLE

        public static final LifecycleState IDLE
        The component is idle and has no associated connections to identify. This is most commonly the case with "on demand" services, when no endpoints are registered. In this case "DISCONNECTED" is not the right way to describe its state.
    • Method Detail

      • values

        public static LifecycleState[] 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 (LifecycleState c : LifecycleState.values())
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static LifecycleState 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.)
        name - the name of the enum constant to be returned.
        the enum constant with the specified name
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null