Enum Service.State
- All Implemented Interfaces:
Serializable
,Comparable<Service.State>
,Constable
- Enclosing interface:
Service
The lifecycle states of a service.
The ordering of the Service.State
enum is defined such that if there is a state transition
from A -> B
then A.compareTo(B) < 0
. N.B. The converse is not true, i.e. if
A.compareTo(B) < 0
then there is not guaranteed to be a valid state transition
A -> B
.
- Since:
- 9.0 (in 1.0 as
com.google.common.base.Service.State
) - Author:
- Jesse Wilson, Luke Sandberg
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionA service in this state has encountered a problem and may not be operational.A service in this state is inactive.A service in this state is operational.A service in this state is transitioning toRUNNING
.A service in this state is transitioning toTERMINATED
.A service in this state has completed execution normally. -
Method Summary
Modifier and TypeMethodDescriptionstatic Service.State
Returns the enum constant of this type with the specified name.static Service.State[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
NEW
A service in this state is inactive. It does minimal work and consumes minimal resources. -
STARTING
A service in this state is transitioning toRUNNING
. -
RUNNING
A service in this state is operational. -
STOPPING
A service in this state is transitioning toTERMINATED
. -
TERMINATED
A service in this state has completed execution normally. It does minimal work and consumes minimal resources. -
FAILED
A service in this state has encountered a problem and may not be operational. It cannot be started nor stopped.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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 nameNullPointerException
- if the argument is null
-