org.huihoo.jfox.service
Class State

java.lang.Object
  |
  +--org.huihoo.jfox.service.State

public final class State
extends java.lang.Object

Author:
Young Yang

Field Summary
static State DESTROYED
          DESTROYED, service stopped and it's resource destoryed, example: it's connection closed
static State DESTROYING
          DESTROYING, service is in destroying
 int id
           
static State INITIALIZED
          INITIALIZED, service is initialized
static State INITIALIZING
          INITIALIZING, service is in initializing, doCreate()
static State INTERRUPTED
          INTERRUPPTED, service interrupted because of some error or exception
 java.lang.String name
           
static State ORIGINAL
           
static State STARTED
          STARTED, service has started
static State STARTING
          STOPPING, service is in starting
static State STOPPED
          STOPPED, service stopped by user
static State STOPPING
          STOPPING, service is in stopping
 
Constructor Summary
State(int id, java.lang.String name)
           
 
Method Summary
static boolean canDestroy(State state)
           
static boolean canInit(State state)
           
static boolean canStart(State state)
           
static boolean canStop(State state)
           
 boolean equals(java.lang.Object obj)
           
 int getId()
           
 java.lang.String getName()
           
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ORIGINAL

public static final State ORIGINAL

INITIALIZING

public static final State INITIALIZING
INITIALIZING, service is in initializing, doCreate()

INITIALIZED

public static final State INITIALIZED
INITIALIZED, service is initialized

STARTING

public static final State STARTING
STOPPING, service is in starting

STARTED

public static final State STARTED
STARTED, service has started

STOPPING

public static final State STOPPING
STOPPING, service is in stopping

STOPPED

public static final State STOPPED
STOPPED, service stopped by user

DESTROYING

public static final State DESTROYING
DESTROYING, service is in destroying

DESTROYED

public static final State DESTROYED
DESTROYED, service stopped and it's resource destoryed, example: it's connection closed

INTERRUPTED

public static final State INTERRUPTED
INTERRUPPTED, service interrupted because of some error or exception

id

public int id

name

public java.lang.String name
Constructor Detail

State

public State(int id,
             java.lang.String name)
Method Detail

getId

public int getId()

getName

public java.lang.String getName()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

canInit

public static boolean canInit(State state)

canStart

public static boolean canStart(State state)

canStop

public static boolean canStop(State state)

canDestroy

public static boolean canDestroy(State state)