Enum ServiceState

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<ServiceState>

    public enum ServiceState
    extends java.lang.Enum<ServiceState>
    Service states. See also platform handbook, state machine for valid service state transitions.
    Author:
    Holger Eichelberger, SSE
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      ACTIVATING
      The service is re-activating from PASSIVATED or MIGRATING.
      AVAILABLE
      The service implementation is available but not in any other state.
      CREATED
      The local service instance being observed has been created.
      DEPLOYING
      The service is being deployed, but it is not "created" and not running.
      FAILED
      Something failed.
      MIGRATING
      The service is PASSIVATED and in progress of being migrated.
      PASSIVATED
      The service is passivated and can be adapted/migrated safely.
      PASSIVATING
      The service is passivating for an adaptation.
      RECONFIGURING
      The service is being reconfigured.
      RECOVERED
      The service is recovered and shall now switch back to the previous non-failure/recovering state, in particular RUNNING/processing.
      RECOVERING
      The service is recovering from a failure, i.e., not RUNNING/processing.
      RUNNING
      The service is running under normal conditions, i.e., processing data.
      STARTING
      The service is starting.
      STOPPED
      The service is stopped, in particular not RUNNING/processing..
      STOPPING
      The service is stopping.
      UNDEPLOYING
      After STOPPED the service is not going back to STARTING rather than being undeployed and disposed.
      UNKNOWN
      The state of the service is not known.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private ServiceState()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private static void addValidTransition​(ServiceState source, ServiceState... targets)
      Adds a valid transition.
      boolean isValidTransition​(ServiceState target)
      Returns whether a transition from this state to target is valid.
      static void validateTransition​(ServiceState source, ServiceState target)
      Validates a service state transition and throws an exception if the transition is invalid.
      static ServiceState valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static ServiceState[] 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

      • AVAILABLE

        public static final ServiceState AVAILABLE
        The service implementation is available but not in any other state.
      • DEPLOYING

        public static final ServiceState DEPLOYING
        The service is being deployed, but it is not "created" and not running.
      • CREATED

        public static final ServiceState CREATED
        The local service instance being observed has been created.
      • RUNNING

        public static final ServiceState RUNNING
        The service is running under normal conditions, i.e., processing data.
      • FAILED

        public static final ServiceState FAILED
        Something failed. The service is not behaving normally. May go back to #RUNNING, RECOVERING, or STOPPED.
      • STOPPING

        public static final ServiceState STOPPING
        The service is stopping.
      • STOPPED

        public static final ServiceState STOPPED
        The service is stopped, in particular not RUNNING/processing..
      • PASSIVATING

        public static final ServiceState PASSIVATING
        The service is passivating for an adaptation.
      • PASSIVATED

        public static final ServiceState PASSIVATED
        The service is passivated and can be adapted/migrated safely.
      • MIGRATING

        public static final ServiceState MIGRATING
        The service is PASSIVATED and in progress of being migrated.
      • RECOVERING

        public static final ServiceState RECOVERING
        The service is recovering from a failure, i.e., not RUNNING/processing.
      • RECOVERED

        public static final ServiceState RECOVERED
        The service is recovered and shall now switch back to the previous non-failure/recovering state, in particular RUNNING/processing.
      • UNDEPLOYING

        public static final ServiceState UNDEPLOYING
        After STOPPED the service is not going back to STARTING rather than being undeployed and disposed.
      • UNKNOWN

        public static final ServiceState UNKNOWN
        The state of the service is not known.
    • Constructor Detail

      • ServiceState

        private ServiceState()
    • Method Detail

      • values

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

        public static ServiceState valueOf​(java.lang.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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • addValidTransition

        private static void addValidTransition​(ServiceState source,
                                               ServiceState... targets)
        Adds a valid transition. Transitions to FAILED or UNKNOWN are implicitly valid.
        Parameters:
        source - the source state to transition from
        targets - the target state(s) to transition to
      • isValidTransition

        public boolean isValidTransition​(ServiceState target)
        Returns whether a transition from this state to target is valid.
        Parameters:
        target - the target state
        Returns:
        true for valid, false else
      • validateTransition

        public static void validateTransition​(ServiceState source,
                                              ServiceState target)
                                       throws java.util.concurrent.ExecutionException
        Validates a service state transition and throws an exception if the transition is invalid.
        Parameters:
        source - the source state
        target - the target state
        Throws:
        java.util.concurrent.ExecutionException - if source is null or a transition from source to target is not valid