com.ibm.websphere.management.dynamicproxy
Class StateObject

java.lang.Object
  |
  +--com.ibm.websphere.management.dynamicproxy.StateObject
All Implemented Interfaces:
java.io.Serializable

public abstract class StateObject
extends java.lang.Object
implements java.io.Serializable

StateObject abstract class which needs to be extended by the MBean provider. Subclass of this StateObject can be specified in MBeanDescriptor's MBean xml tag's attribute called "stateObjectClass" in order for JMX runtime to new it up before the dynamicproxy MBean completes its initialization & attach it onto dynamicproxy's InvocationHandler for keeping track of dynamicproxy's current state.

example MBeanDescriptor header & initial MBean tag:

 <?xml version="1.0" encoding="UTF-8"?> 
 <!DOCTYPE MBean SYSTEM "MbeanDescriptor.dtd"> 
 < MBean type="SampleStateMBean" 
  collaboratorClass="com.ibm.ws390.scaffold.SampleStateMBeanProxy" 
  aggregationHandlerClass="com.ibm.ws390.scaffold.SampleStateAggregationHandler" 
  eventHandlerClass="com.ibm.ws390.scaffold.SampleStateEventHandler" 
  invocationHandlerClass="com.ibm.ws390.scaffold.SampleStateInvocationHandler" 
  stateObjectClass="com.ibm.ws390.scaffold.SampleState" 
  version="5.0" 
  platform="dynamicproxy" 
  description="Sample state MBean."> 
 : 
 : 
 
NOTE: any methods declared in StateObject implementation class should be marked "synchronized" to lock the StateObject instance from other threads.

See Also:
Serialized Form

Constructor Summary
StateObject()
           
 
Method Summary
abstract  java.lang.String getStateObjectInfo()
          Required method that all StateObject implementation should provide in order to show the detail content of the state in a provider specific way.
 java.lang.String toString()
          Conveniently overrides the toString() method, so that enforced state object info getter is used to display the stateobject content in a provider specific way along with its StateObject implementation name prepended.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StateObject

public StateObject()
Method Detail

getStateObjectInfo

public abstract java.lang.String getStateObjectInfo()
Required method that all StateObject implementation should provide in order to show the detail content of the state in a provider specific way. This method will get called by built-in toString method to provide an implementation specific debugging information during runtime.


toString

public java.lang.String toString()
Conveniently overrides the toString() method, so that enforced state object info getter is used to display the stateobject content in a provider specific way along with its StateObject implementation name prepended. This method is used within the runtime when the state object is being fetched from the Controller proxy MBean during initialization, therefore make sure to provide meaningful state object info in case debugging is necessary via getStateObjectInfo method.

Overrides:
toString in class java.lang.Object