Enum ServiceLifeCycle
- java.lang.Object
-
- java.lang.Enum<ServiceLifeCycle>
-
- de.dytanic.cloudnet.driver.service.ServiceLifeCycle
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<ServiceLifeCycle>
public enum ServiceLifeCycle extends java.lang.Enum<ServiceLifeCycle>
The current state of a service.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description DEFINEDThis will only be for a very short time after the creation of a service if theCloudServicePrePrepareEventin the node isn't cancelled.DELETEDThis is the state afterSTOPPED.PREPAREDThis is the state directly afterDEFINEDor afterSTOPPED(only if autoDeleteOnStop is disabled for the service).RUNNINGThis is the state afterPREPARED.STOPPEDThis is the state afterRUNNING.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ServiceLifeCyclevalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static ServiceLifeCycle[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
DEFINED
public static final ServiceLifeCycle DEFINED
This will only be for a very short time after the creation of a service if theCloudServicePrePrepareEventin the node isn't cancelled. After that event has been called, CloudNet will only copy the SSL certificates if necessary and directly switch to thePREPAREDstate after it.
-
PREPARED
public static final ServiceLifeCycle PREPARED
This is the state directly afterDEFINEDor afterSTOPPED(only if autoDeleteOnStop is disabled for the service). It will be prepared until it is changed toRUNNINGbySpecificCloudServiceProvider.start().
-
RUNNING
public static final ServiceLifeCycle RUNNING
This is the state afterPREPARED. It is invoked bySpecificCloudServiceProvider.start(). It will be running until the process of the service has exited.
-
STOPPED
public static final ServiceLifeCycle STOPPED
This is the state afterRUNNING. It is invoked by exiting the process. This will only be for a very short time after the process has exited. There are two possibilities for the next state: - If autoDeleteOnStop is enabled, the state will be switched toDELETED. - If autoDeleteOnStop is disabled, the state will be switched toPREPARED.
-
DELETED
public static final ServiceLifeCycle DELETED
This is the state afterSTOPPED. When this state is set, the service is no more registered in the cloud and methods likeGeneralCloudServiceProvider.getCloudService(UUID)won't return this service anymore.
-
-
Method Detail
-
values
public static ServiceLifeCycle[] 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 (ServiceLifeCycle c : ServiceLifeCycle.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ServiceLifeCycle 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 namejava.lang.NullPointerException- if the argument is null
-
-