javax.slee.management
Class SleeState

java.lang.Object
  |
  +--javax.slee.management.SleeState
All Implemented Interfaces:
java.io.Serializable

public final class SleeState
extends java.lang.Object
implements java.io.Serializable

This class defines an enumerated type that encapsulates the operational state of the SLEE.

A singleton instance of each enumerated value is guaranteed (via an implementation of readResolve() - refer java.io.Serializable), so that equality tests using == are always evaluated correctly. (This equality test is only guaranteed if this class is loaded in the application's boot class path, rather than dynamically loaded at runtime.)

See Also:
Serialized Form

Field Summary
static SleeState RUNNING
          In the RUNNING state the SLEE and resource adaptors are generating events and the SLEE's event routing subsystem is actively creating SBBs and delivering events to them.
static int SLEE_RUNNING
          An integer representation of the RUNNING state.
static int SLEE_STARTING
          An integer representation of the STARTING state.
static int SLEE_STOPPED
          An integer representation of the STOPPED state.
static int SLEE_STOPPING
          An integer representation of the STOPPING state.
static SleeState STARTING
          The STARTING state is a transitional state between STOPPED and RUNNING.
static SleeState STOPPED
          The STOPPED state is the initial state for the SLEE on startup.
static SleeState STOPPING
          The STOPPING state is a transitional state between STARTING or RUNNING and STOPPED.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compare this SLEE state for equality with another.
static SleeState fromInt(int state)
          Get a SleeState object from an integer value.
 int hashCode()
          Get a hash code value for this SLEE state.
 boolean isRunning()
          Determine if this SleeState object represents the RUNNING state of the SLEE.
 boolean isStarting()
          Determine if this SleeState object represents the STARTING state of the SLEE.
 boolean isStopped()
          Determine if this SleeState object represents the STOPPED state of the SLEE.
 boolean isStopping()
          Determine if this SleeState object represents the STOPPING state of the SLEE.
 int toInt()
          Get an integer value representation for this SleeState object.
 java.lang.String toString()
          Get the textual representation of the SLEE state object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

SLEE_STOPPED

public static final int SLEE_STOPPED
An integer representation of the STOPPED state.

SLEE_STARTING

public static final int SLEE_STARTING
An integer representation of the STARTING state.

SLEE_RUNNING

public static final int SLEE_RUNNING
An integer representation of the RUNNING state.

SLEE_STOPPING

public static final int SLEE_STOPPING
An integer representation of the STOPPING state.

STOPPED

public static final SleeState STOPPED
The STOPPED state is the initial state for the SLEE on startup. When in this state, the the SLEE and resource adaptors do not generate events and SLEE's event routing subsystem is idle.

STARTING

public static final SleeState STARTING
The STARTING state is a transitional state between STOPPED and RUNNING. When in this state, the SLEE is activating relevant resource adaptors and performing any other tasks necessary to start event processing. The event router is not yet started in this state.

RUNNING

public static final SleeState RUNNING
In the RUNNING state the SLEE and resource adaptors are generating events and the SLEE's event routing subsystem is actively creating SBBs and delivering events to them.

STOPPING

public static final SleeState STOPPING
The STOPPING state is a transitional state between STARTING or RUNNING and STOPPED. When in this state any remaining activities are allowed to complete without new activities being created.
Method Detail

fromInt

public static SleeState fromInt(int state)
                         throws java.lang.IllegalArgumentException
Get a SleeState object from an integer value.
Parameters:
state - the state as an integer.
Returns:
a SleeState object corresponding to state.
Throws:
java.lang.IllegalArgumentException - if state is not a valid state value.

toInt

public int toInt()
Get an integer value representation for this SleeState object.
Returns:
an integer value representation for this SleeState object.

isStopped

public boolean isStopped()
Determine if this SleeState object represents the STOPPED state of the SLEE.

This method is effectively equivalent to the conditional test: (this == STOPPED), ie. the code:

    if (state.isStopped()) ...

is interchangeable with the code:

   if (state == SleeState.STOPPED) ...

Returns:
true if this object represents the STOPPED state of the SLEE, false otherwise.

isStarting

public boolean isStarting()
Determine if this SleeState object represents the STARTING state of the SLEE.

This method is effectively equivalent to the conditional test: (this == STARTING), ie. the code:

    if (state.isStarting()) ...

is interchangeable with the code:

   if (state == SleeState.STARTING) ...

Returns:
true if this object represents the STARTING state of the SLEE, false otherwise.

isRunning

public boolean isRunning()
Determine if this SleeState object represents the RUNNING state of the SLEE.

This method is effectively equivalent to the conditional test: (this == RUNNING), ie. the code:

    if (state.isRunning()) ...

is interchangeable with the code:

   if (state == SleeState.RUNNING) ...

Returns:
true if this object represents the RUNNING state of the SLEE, false otherwise.

isStopping

public boolean isStopping()
Determine if this SleeState object represents the STOPPING state of the SLEE.

This method is effectively equivalent to the conditional test: (this == STOPPING), ie. the code:

    if (state.isStopping()) ...

is interchangeable with the code:

   if (state == SleeState.STOPPING) ...

Returns:
true if this object represents the STOPPING state of the SLEE, false otherwise.

equals

public boolean equals(java.lang.Object obj)
Compare this SLEE state for equality with another.
Overrides:
equals in class java.lang.Object
Parameters:
obj - the object to compare this with.
Returns:
true if obj is an instance of this class representing the same SLEE state as this, false otherwise.

hashCode

public int hashCode()
Get a hash code value for this SLEE state.
Overrides:
hashCode in class java.lang.Object
Returns:
a hash code value.

toString

public java.lang.String toString()
Get the textual representation of the SLEE state object.
Overrides:
toString in class java.lang.Object
Returns:
the textual representation of the SLEE state object.