javax.slee.management
Class ResourceAdaptorEntityState

java.lang.Object
  extended by javax.slee.management.ResourceAdaptorEntityState
All Implemented Interfaces:
java.io.Serializable

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

This class defines an enumerated type that encapsulates the state of a Resource Adaptor Entity.

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.)

Since:
SLEE 1.1
See Also:
Serialized Form

Field Summary
static ResourceAdaptorEntityState ACTIVE
          The ACTIVE state indicates that the resource adaptor entity has been activated and it is able to deliver events from the underlying resource to the SLEE.
static java.lang.String ACTIVE_STRING
          A string representation of the ACTIVE state.
static int ENTITY_ACTIVE
          An integer representation of the ACTIVE state.
static int ENTITY_INACTIVE
          An integer representation of the INACTIVE state.
static int ENTITY_STOPPING
          An integer representation of the STOPPING state.
static ResourceAdaptorEntityState INACTIVE
          The INACTIVE state indicates that the resource adaptor entity has been successfully created and configured.
static java.lang.String INACTIVE_STRING
          A string representation of the INACTIVE state.
static ResourceAdaptorEntityState STOPPING
          The STOPPING state indicates that an active resource adaptor entity has been deactivated but some activities created by the resource adaptor entity still exist.
static java.lang.String STOPPING_STRING
          A string representation of the STOPPING state.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compare this resource adaptor state for equality with another.
static ResourceAdaptorEntityState fromInt(int state)
          Get a ResourceAdaptorEntityState object from an integer value.
static ResourceAdaptorEntityState fromString(java.lang.String state)
          Get a ResourceAdaptorEntityState object from a string value.
 int hashCode()
          Get a hash code value for this resource adaptor state.
 boolean isActive()
          Determine if this ResourceAdaptorEntityState object represents the ACTIVE state of a resource adaptor entity.
 boolean isInactive()
          Determine if this ResourceAdaptorEntityState object represents the INACTIVE state of a resource adaptor entity.
 boolean isStopping()
          Determine if this ResourceAdaptorEntityState object represents the STOPPING state of a resource adaptor entity.
 int toInt()
          Get an integer value representation for this ResourceAdaptorEntityState object.
 java.lang.String toString()
          Get the textual representation of the ResourceAdaptorEntityState object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ENTITY_INACTIVE

public static final int ENTITY_INACTIVE
An integer representation of the INACTIVE state.

See Also:
Constant Field Values

ENTITY_ACTIVE

public static final int ENTITY_ACTIVE
An integer representation of the ACTIVE state.

See Also:
Constant Field Values

ENTITY_STOPPING

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

See Also:
Constant Field Values

INACTIVE_STRING

public static final java.lang.String INACTIVE_STRING
A string representation of the INACTIVE state.

See Also:
Constant Field Values

ACTIVE_STRING

public static final java.lang.String ACTIVE_STRING
A string representation of the ACTIVE state.

See Also:
Constant Field Values

STOPPING_STRING

public static final java.lang.String STOPPING_STRING
A string representation of the STOPPING state.

See Also:
Constant Field Values

INACTIVE

public static final ResourceAdaptorEntityState INACTIVE
The INACTIVE state indicates that the resource adaptor entity has been successfully created and configured. All required files and parameters have been set up, so that the resource adaptor entity may be connected to the underlying resource, but it is not currently producing events.


ACTIVE

public static final ResourceAdaptorEntityState ACTIVE
The ACTIVE state indicates that the resource adaptor entity has been activated and it is able to deliver events from the underlying resource to the SLEE.


STOPPING

public static final ResourceAdaptorEntityState STOPPING
The STOPPING state indicates that an active resource adaptor entity has been deactivated but some activities created by the resource adaptor entity still exist. Once all activities have completed, the resource adaptor entity state spontaneously returns to the INACTIVE state.

Method Detail

fromInt

public static ResourceAdaptorEntityState fromInt(int state)
                                          throws java.lang.IllegalArgumentException
Get a ResourceAdaptorEntityState object from an integer value.

Parameters:
state - the state as an integer.
Returns:
a ResourceAdaptorEntityState object corresponding to state.
Throws:
java.lang.IllegalArgumentException - if state is not a valid resource adaptor entity state value.

fromString

public static ResourceAdaptorEntityState fromString(java.lang.String state)
                                             throws java.lang.NullPointerException,
                                                    java.lang.IllegalArgumentException
Get a ResourceAdaptorEntityState object from a string value.

Parameters:
state - the state as a string, for example as returned by the toString() method (case insensitive).
Returns:
a ResourceAdaptorEntityState object corresponding to state.
Throws:
java.lang.NullPointerException - if state is null.
java.lang.IllegalArgumentException - if state is not a valid resource adaptor entity state string.

toInt

public int toInt()
Get an integer value representation for this ResourceAdaptorEntityState object.

Returns:
an integer value representation for this ResourceAdaptorEntityState object.

isInactive

public boolean isInactive()
Determine if this ResourceAdaptorEntityState object represents the INACTIVE state of a resource adaptor entity.

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

    if (state.isInactive()) ...

is interchangeable with the code:

   if (state == ResourceAdaptorEntityState.INACTIVE) ...

Returns:
true if this object represents the INACTIVE state of a resource adaptor entity, false otherwise.

isActive

public boolean isActive()
Determine if this ResourceAdaptorEntityState object represents the ACTIVE state of a resource adaptor entity.

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

    if (state.isActive()) ...

is interchangeable with the code:

   if (state == ResourceAdaptorEntityState.ACTIVE) ...

Returns:
true if this object represents the ACTIVE state of a resource adaptor entity, false otherwise.

isStopping

public boolean isStopping()
Determine if this ResourceAdaptorEntityState object represents the STOPPING state of a resource adaptor entity.

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

    if (state.isStopping()) ...

is interchangeable with the code:

   if (state == ResourceAdaptorEntityState.STOPPING) ...

Returns:
true if this object represents the STOPPING state of a resource adaptor entity, false otherwise.

equals

public boolean equals(java.lang.Object obj)
Compare this resource adaptor 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 resource adaptor state as this, false otherwise.

hashCode

public int hashCode()
Get a hash code value for this resource adaptor 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 ResourceAdaptorEntityState object.

Overrides:
toString in class java.lang.Object
Returns:
the textual representation of the ResourceAdaptorEntityState object.


Copyright © 2008. All Rights Reserved.