org.javagamesfactory.nioservers
Enum ServerState

java.lang.Object
  extended by java.lang.Enum<ServerState>
      extended by org.javagamesfactory.nioservers.ServerState
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<ServerState>

public enum ServerState
extends java.lang.Enum<ServerState>

Represents the core internal state of any StringBasedServer (or subclass)

All servers are INITIALIZING at the moment of constructor call, and remain in that state until they are started. While attempting to start, the server is STARTED, until it either fails and goes to OFFLINE, or succeeds and goes to RUNNING. Stopping a server immediately sends it to STOPPING until it successfully reaches STOPPED, or fails and goes OFFLINE.


Enum Constant Summary
INITIALIZING
           
OFFLINE
           
RUNNING
           
STARTED
           
STOPPED
           
STOPPING
           
 
Method Summary
static ServerState valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static ServerState[] 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

INITIALIZING

public static final ServerState INITIALIZING

STARTED

public static final ServerState STARTED

RUNNING

public static final ServerState RUNNING

STOPPING

public static final ServerState STOPPING

STOPPED

public static final ServerState STOPPED

OFFLINE

public static final ServerState OFFLINE
Method Detail

values

public static ServerState[] 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 (ServerState c : ServerState.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static ServerState 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