Enum Class ServiceState
- All Implemented Interfaces:
Serializable,Comparable<ServiceState>,Constable
Service states. See also platform handbook, state machine for valid service state transitions.
- Author:
- Holger Eichelberger, SSE
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe service is re-activating fromPASSIVATEDorMIGRATING.The service implementation is available but not in any other state.The local service instance being observed has been created.The service is being deployed, but it is not "created" and not running.Something failed.The service isPASSIVATEDand in progress of being migrated.The service is passivated and can be adapted/migrated safely.The service is passivating for an adaptation.The service is being reconfigured.The service is recovered and shall now switch back to the previous non-failure/recovering state, in particularRUNNING/processing.The service is recovering from a failure, i.e., notRUNNING/processing.The service is running under normal conditions, i.e., processing data.The service is starting.The service is stopped, in particular notRUNNING/processing..The service is stopping.The state of the service is not known. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidaddValidTransition(ServiceState source, ServiceState... targets) Adds a valid transition.booleanisValidTransition(ServiceState target) Returns whether a transition from this state totargetis valid.static StringtoString(ServiceState state) Turns the givenstateto a String.static StringtoString(ServiceState state, ServiceState dflt) Turns the givenstateto a String.static voidvalidateTransition(ServiceState source, ServiceState target) Validates a service state transition and throws an exception if the transition is invalid.static ServiceStateReturns the enum constant of this class with the specified name.static ServiceState[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
AVAILABLE
The service implementation is available but not in any other state. -
DEPLOYING
The service is being deployed, but it is not "created" and not running. -
CREATED
The local service instance being observed has been created. -
STARTING
-
RUNNING
The service is running under normal conditions, i.e., processing data. -
FAILED
Something failed. The service is not behaving normally. May go back to#RUNNING,RECOVERING, orSTOPPED. -
STOPPING
The service is stopping. -
STOPPED
The service is stopped, in particular notRUNNING/processing.. -
PASSIVATING
The service is passivating for an adaptation. -
PASSIVATED
The service is passivated and can be adapted/migrated safely. -
MIGRATING
The service isPASSIVATEDand in progress of being migrated. -
ACTIVATING
The service is re-activating fromPASSIVATEDorMIGRATING. -
RECOVERING
The service is recovering from a failure, i.e., notRUNNING/processing. -
RECOVERED
The service is recovered and shall now switch back to the previous non-failure/recovering state, in particularRUNNING/processing. -
RECONFIGURING
The service is being reconfigured. Depending on the reconfiguration, this may go viaPASSIVATING,PASSIVATED,ACTIVATINGor it may directly come from/go toRUNNING. -
UNDEPLOYING
-
UNKNOWN
The state of the service is not known.
-
-
Field Details
-
validTransitions
-
-
Constructor Details
-
ServiceState
private ServiceState()
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
addValidTransition
- Parameters:
source- the source state to transition fromtargets- the target state(s) to transition to
-
isValidTransition
Returns whether a transition from this state totargetis valid.- Parameters:
target- the target state- Returns:
truefor valid,falseelse
-
validateTransition
public static void validateTransition(ServiceState source, ServiceState target) throws ExecutionException Validates a service state transition and throws an exception if the transition is invalid.- Parameters:
source- the source statetarget- the target state- Throws:
ExecutionException- ifsourceis null or a transition fromsourcetotargetis not valid
-
toString
Turns the givenstateto a String.- Parameters:
state- the state to turn into a String, may be null,UNKNOWNis used then- Returns:
- the string representation
-
toString
Turns the givenstateto a String.- Parameters:
state- the state to turn into a String, may be null,stateis used thendflt- the default value to use ifstateis null- Returns:
- the string representation
-