org.jboss.management.j2ee
Class J2EEManagedObject

java.lang.Object
  extended byorg.jboss.mx.util.JBossNotificationBroadcasterSupport (src) 
      extended byorg.jboss.system.ServiceMBeanSupport (src) 
          extended byorg.jboss.management.j2ee.J2EEManagedObject
All Implemented Interfaces:
MBeanRegistration (src) , NotificationBroadcaster (src) , NotificationEmitter (src) , Service (src) , ServiceMBean (src)
Direct Known Subclasses:
EJB (src) , J2EEDeployedObject (src) , J2EEDomain (src) , J2EEDomainTarget (src) , J2EEResource (src) , J2EEServer (src) , JCAConnectionFactory (src) , JCAManagedConnectionFactory (src) , JDBCDataSource (src) , JDBCDriver (src) , JVM (src) , MBean (src) , ResourceAdapter (src) , Servlet (src)

public abstract class J2EEManagedObject
extends ServiceMBeanSupport (src)

Root class of the JBoss JSR-77 implementation of J2EEManagedObject.


Field Summary
static java.lang.String NAME
           
static java.lang.String TYPE
           
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport (src)
log, server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.system.ServiceMBean (src)
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
J2EEManagedObject(java.lang.String j2eeType, java.lang.String resName, ObjectName (src)  jsr77ParentName)
          Constructor for any Managed Object except the root J2EEMangement.
J2EEManagedObject(java.lang.String domainName, java.lang.String j2eeType, java.lang.String resName)
          Constructor for the root J2EEDomain object
 
Method Summary
 void addChild(ObjectName (src)  pChild)
           
 java.lang.String getobjectName()
           
 ObjectName (src) getObjectName()
           
 ObjectName (src) getObjectName(MBeanServer (src)  pServer, ObjectName (src)  pName)
          Sub-classes should override this method if they only need to set their object name during MBean pre-registration.
 java.lang.String getparent()
           
protected  java.util.Hashtable getParentKeys(ObjectName (src)  pParent)
          This method can be overwritten by any subclass which must return <parent-j2eeType> indicating its parents.
protected static java.lang.String getType(ObjectName (src)  pName)
          Retrieves the type out of an JSR-77 object name
protected static java.lang.String getType(java.lang.String pName)
          Retrieves the type out of an JSR-77 object name
 boolean iseventProvider()
           
 boolean isstateManageable()
           
 boolean isstatisticsProvider()
           
protected static ObjectName (src) newObjectName(java.lang.String pName)
          Return the ObjectName that is represented by the given string.
protected  void postCreation()
           
 void postRegister(java.lang.Boolean registrationDone)
          Last steps to be done after MBean is registered on MBeanServer.
 void preDeregister()
          Last steps to be done before MBean is unregistered on MBeanServer.
protected  void preDestruction()
           
 void removeChild(ObjectName (src)  pChild)
           
protected static ObjectName (src) removeObject(MBeanServer (src)  pServer, java.lang.String pSearchCriteria)
           
protected static ObjectName (src) removeObject(MBeanServer (src)  pServer, java.lang.String pName, java.lang.String pSearchCriteria)
           
 void sendNotification(java.lang.String type, java.lang.String info)
          An overload of the super sendNotification that only takes the event type and msg.
 void setparent(java.lang.String pParent)
           
 java.lang.String toString()
           
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport (src)
create, createService, destroy, destroyService, getLog, getName, getNextNotificationSequenceNumber, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, preRegister, start, startService, stop, stopService
 
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport (src)
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE

public static final java.lang.String TYPE
See Also:
Constant Field Values (src)

NAME

public static final java.lang.String NAME
See Also:
Constant Field Values (src)
Constructor Detail

J2EEManagedObject

public J2EEManagedObject(java.lang.String domainName,
                         java.lang.String j2eeType,
                         java.lang.String resName)
                  throws MalformedObjectNameException (src) 
Constructor for the root J2EEDomain object

Parameters:
domainName - domain portion to use for the JMX ObjectName
j2eeType - JSR77 j2ee-type of the resource being created
resName - Name of the managed resource
Throws:
java.security.InvalidParameterException - If the given Domain Name, Type or Name is null
MalformedObjectNameException (src)

J2EEManagedObject

public J2EEManagedObject(java.lang.String j2eeType,
                         java.lang.String resName,
                         ObjectName (src)  jsr77ParentName)
                  throws MalformedObjectNameException (src) ,
                         InvalidParentException (src) 
Constructor for any Managed Object except the root J2EEMangement.

Parameters:
j2eeType - JSR77 j2ee-type of the resource being created
resName - name of the resource
jsr77ParentName - Object Name of the parent of this Managed Object which must be defined
Throws:
java.security.InvalidParameterException - If the given Type, Name or Parent is null
MalformedObjectNameException (src)
InvalidParentException (src)
Method Detail

getType

protected static java.lang.String getType(java.lang.String pName)
Retrieves the type out of an JSR-77 object name

Parameters:
pName - Object Name to check if null then it will be treated like NO type found
Returns:
The type of the given Object Name or an EMPTY string if either Object Name null or type not found

getType

protected static java.lang.String getType(ObjectName (src)  pName)
Retrieves the type out of an JSR-77 object name

Parameters:
pName - Object Name to check if null then it will be treated like NO type found
Returns:
The type of the given Object Name or an EMPTY string if either Object Name null or type not found

newObjectName

protected static ObjectName (src)  newObjectName(java.lang.String pName)
Return the ObjectName that is represented by the given string.

Parameters:
pName - a object name

removeObject

protected static ObjectName (src)  removeObject(MBeanServer (src)  pServer,
                                         java.lang.String pSearchCriteria)
                                  throws JMException (src) 
Throws:
JMException (src)

removeObject

protected static ObjectName (src)  removeObject(MBeanServer (src)  pServer,
                                         java.lang.String pName,
                                         java.lang.String pSearchCriteria)
                                  throws JMException (src) 
Throws:
JMException (src)

getObjectName

public ObjectName (src)  getObjectName()

getobjectName

public java.lang.String getobjectName()

getparent

public java.lang.String getparent()

setparent

public void setparent(java.lang.String pParent)
               throws InvalidParentException (src) 
Throws:
InvalidParentException (src)

addChild

public void addChild(ObjectName (src)  pChild)

removeChild

public void removeChild(ObjectName (src)  pChild)

isstateManageable

public boolean isstateManageable()

isstatisticsProvider

public boolean isstatisticsProvider()

iseventProvider

public boolean iseventProvider()

getObjectName

public ObjectName (src)  getObjectName(MBeanServer (src)  pServer,
                                ObjectName (src)  pName)
Description copied from class: ServiceMBeanSupport (src)
Sub-classes should override this method if they only need to set their object name during MBean pre-registration.

Overrides:
getObjectName in class ServiceMBeanSupport (src)

postRegister

public final void postRegister(java.lang.Boolean registrationDone)
Last steps to be done after MBean is registered on MBeanServer. This method is made final because it contains vital steps mandatory to all J2EEManagedObjects. To perform your own Post-Creation steps please override postCreation() method.

Specified by:
postRegister in interface MBeanRegistration (src)
Overrides:
postRegister in class ServiceMBeanSupport (src)

preDeregister

public final void preDeregister()
                         throws java.lang.Exception
Last steps to be done before MBean is unregistered on MBeanServer. This method is made final because it contains vital steps mandatory to all J2EEManagedObjects. To perform your own Pre-Destruction steps please override preDestruction() method.

Specified by:
preDeregister in interface MBeanRegistration (src)
Overrides:
preDeregister in class ServiceMBeanSupport (src)
Throws:
java.lang.Exception

sendNotification

public void sendNotification(java.lang.String type,
                             java.lang.String info)
An overload of the super sendNotification that only takes the event type and msg. The source will be set to the managed object name, the sequence will be the getNextNotificationSequenceNumber() value, and the timestamp System.currentTimeMillis().

Parameters:
type - the notification event type
info - the notification event msg info

toString

public java.lang.String toString()

postCreation

protected void postCreation()

preDestruction

protected void preDestruction()

getParentKeys

protected java.util.Hashtable getParentKeys(ObjectName (src)  pParent)
This method can be overwritten by any subclass which must return <parent-j2eeType> indicating its parents. By default it returns an empty hashtable instance.

Parameters:
pParent - The direct parent of this class
Returns:
An empty hashtable