org.jboss.management.j2ee
Class StateManagement

java.lang.Object
  extended byorg.jboss.management.j2ee.StateManagement
All Implemented Interfaces:
java.util.EventListener, NotificationListener (src)

public class StateManagement
extends java.lang.Object
implements NotificationListener (src)

Root class of the JBoss JSR-77 implementation of StateManagement


Field Summary
static int CREATED
           
static int DESTROYED
           
static int REGISTERED
           
static java.lang.String[] stateTypes
          The int state to state name mappings
static int UNREGISTERED
           
 
Constructor Summary
StateManagement(J2EEManagedObject (src)  managedObject)
           
 
Method Summary
static int convertJBossState(int theState)
          Converts a state from JBoss ServiceMBean to the JSR-77 state
static int convertJSR77State(int theState)
          Converts a JSR-77 state to the JBoss ServiceMBean state
 long getStartTime()
           
 int getState()
           
 java.lang.String getStateString()
           
 void handleNotification(Notification (src)  msg, java.lang.Object handback)
          A notification from the underlying JBoss service.
 void setStartTime(long pTime)
           
 void setState(int newState)
          Sets a new state and if it changed the appropriate state change event is sent.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CREATED

public static final int CREATED
See Also:
Constant Field Values (src)

DESTROYED

public static final int DESTROYED
See Also:
Constant Field Values (src)

REGISTERED

public static final int REGISTERED
See Also:
Constant Field Values (src)

UNREGISTERED

public static final int UNREGISTERED
See Also:
Constant Field Values (src)

stateTypes

public static final java.lang.String[] stateTypes
The int state to state name mappings

Constructor Detail

StateManagement

public StateManagement(J2EEManagedObject (src)  managedObject)
Parameters:
managedObject -
Throws:
java.security.InvalidParameterException - If the given Name is null
Method Detail

convertJBossState

public static int convertJBossState(int theState)
Converts a state from JBoss ServiceMBean to the JSR-77 state

Parameters:
theState - the JBoss ServiceMBean state.
Returns:
Converted state or -1 if unknown.

convertJSR77State

public static int convertJSR77State(int theState)
Converts a JSR-77 state to the JBoss ServiceMBean state

Parameters:
theState - the JSR-77 state.
Returns:
Converted state or -1 if unknown.

getStartTime

public long getStartTime()

setStartTime

public void setStartTime(long pTime)

getState

public int getState()

getStateString

public java.lang.String getStateString()

setState

public void setState(int newState)
Sets a new state and if it changed the appropriate state change event is sent.

Parameters:
newState - Integer indicating the new state according to StateManageable (src) constants

handleNotification

public void handleNotification(Notification (src)  msg,
                               java.lang.Object handback)
A notification from the underlying JBoss service.

Specified by:
handleNotification in interface NotificationListener (src)
Parameters:
msg - The notification msg, AttributeChangeNotification is what we care about
handback - not used

toString

public java.lang.String toString()