org.jboss.management.j2ee
Class J2EEManagedObject

java.lang.Object
  extended by org.jboss.mx.util.JBossNotificationBroadcasterSupport
      extended by org.jboss.management.j2ee.J2EEManagedObject
All Implemented Interfaces:
javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, J2EEManagedObjectMBean
Direct Known Subclasses:
EJB, J2EEDeployedObject, J2EEDomain, J2EEDomainTarget, J2EEResource, J2EEServer, JCAConnectionFactory, JCAManagedConnectionFactory, JDBCDataSource, JDBCDriver, JVM, MBean, ResourceAdapter, Servlet

public abstract class J2EEManagedObject
extends org.jboss.mx.util.JBossNotificationBroadcasterSupport
implements J2EEManagedObjectMBean, javax.management.MBeanRegistration

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

Version:
$Revision: 1.27.4.6 $
Author:
Andreas Schaefer, Scott Stark, Thomas Diesler, Dimitris Andreadis

Field Summary
static String NAME
           
protected  javax.management.MBeanServer server
           
static String TYPE
           
 
Constructor Summary
J2EEManagedObject(String j2eeType, String resName, javax.management.ObjectName jsr77ParentName)
          Constructor for any Managed Object except the root J2EEMangement.
J2EEManagedObject(String domainName, String j2eeType, String resName)
          Constructor for the root J2EEDomain object
 
Method Summary
 void addChild(javax.management.ObjectName pChild)
           
 org.jboss.logging.Logger getLog()
           
protected  long getNextNotificationSequenceNumber()
          The getNextNotificationSequenceNumber method returns the next sequence number for use in notifications.
 String getobjectName()
           
 javax.management.ObjectName getObjectName()
           
 String getparent()
           
protected  Hashtable getParentKeys(javax.management.ObjectName pParent)
          This method can be overwritten by any subclass which must return <parent-j2eeType> indicating its parents.
 javax.management.MBeanServer getServer()
           
protected static String getType(javax.management.ObjectName pName)
          Retrieves the type out of an JSR-77 object name
protected static String getType(String pName)
          Retrieves the type out of an JSR-77 object name
 boolean iseventProvider()
           
 boolean isstateManageable()
           
 boolean isstatisticsProvider()
           
protected static javax.management.ObjectName newObjectName(String pName)
          Return the ObjectName that is represented by the given string.
protected  void postCreation()
           
 void postDeregister()
           
 void postRegister(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()
           
 javax.management.ObjectName preRegister(javax.management.MBeanServer server, javax.management.ObjectName name)
           
 void removeChild(javax.management.ObjectName pChild)
           
protected static javax.management.ObjectName removeObject(javax.management.MBeanServer pServer, String pSearchCriteria)
           
protected static javax.management.ObjectName removeObject(javax.management.MBeanServer pServer, String pName, String pSearchCriteria)
           
 void sendNotification(String type, String info)
          An overload of the super sendNotification that only takes the event type and msg.
 void setparent(String pParent)
           
 String toString()
           
 
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, handleNotification, nextNotificationSequenceNumber, 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 String TYPE
See Also:
Constant Field Values

NAME

public static final String NAME
See Also:
Constant Field Values

server

protected javax.management.MBeanServer server
Constructor Detail

J2EEManagedObject

public J2EEManagedObject(String domainName,
                         String j2eeType,
                         String resName)
                  throws javax.management.MalformedObjectNameException
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:
InvalidParameterException - If the given Domain Name, Type or Name is null
javax.management.MalformedObjectNameException

J2EEManagedObject

public J2EEManagedObject(String j2eeType,
                         String resName,
                         javax.management.ObjectName jsr77ParentName)
                  throws javax.management.MalformedObjectNameException,
                         InvalidParentException
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:
InvalidParameterException - If the given Type, Name or Parent is null
javax.management.MalformedObjectNameException
InvalidParentException
Method Detail

getType

protected static String getType(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 String getType(javax.management.ObjectName 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 javax.management.ObjectName newObjectName(String pName)
Return the ObjectName that is represented by the given string.

Parameters:
pName - a object name

removeObject

protected static javax.management.ObjectName removeObject(javax.management.MBeanServer pServer,
                                                          String pSearchCriteria)
                                                   throws javax.management.JMException
Throws:
javax.management.JMException

removeObject

protected static javax.management.ObjectName removeObject(javax.management.MBeanServer pServer,
                                                          String pName,
                                                          String pSearchCriteria)
                                                   throws javax.management.JMException
Throws:
javax.management.JMException

getLog

public org.jboss.logging.Logger getLog()

getServer

public javax.management.MBeanServer getServer()

getObjectName

public javax.management.ObjectName getObjectName()

getobjectName

public String getobjectName()
Specified by:
getobjectName in interface J2EEManagedObjectMBean

getparent

public String getparent()
Specified by:
getparent in interface J2EEManagedObjectMBean

setparent

public void setparent(String pParent)
               throws InvalidParentException
Specified by:
setparent in interface J2EEManagedObjectMBean
Throws:
InvalidParentException

addChild

public void addChild(javax.management.ObjectName pChild)
Specified by:
addChild in interface J2EEManagedObjectMBean

removeChild

public void removeChild(javax.management.ObjectName pChild)
Specified by:
removeChild in interface J2EEManagedObjectMBean

isstateManageable

public boolean isstateManageable()
Specified by:
isstateManageable in interface J2EEManagedObjectMBean

isstatisticsProvider

public boolean isstatisticsProvider()
Specified by:
isstatisticsProvider in interface J2EEManagedObjectMBean

iseventProvider

public boolean iseventProvider()
Specified by:
iseventProvider in interface J2EEManagedObjectMBean

preRegister

public javax.management.ObjectName preRegister(javax.management.MBeanServer server,
                                               javax.management.ObjectName name)
Specified by:
preRegister in interface javax.management.MBeanRegistration

postRegister

public final void postRegister(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 javax.management.MBeanRegistration

preDeregister

public final void preDeregister()
                         throws 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 javax.management.MBeanRegistration
Throws:
Exception

postDeregister

public void postDeregister()
Specified by:
postDeregister in interface javax.management.MBeanRegistration

sendNotification

public void sendNotification(String type,
                             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 String toString()
Overrides:
toString in class Object

postCreation

protected void postCreation()

preDestruction

protected void preDestruction()

getParentKeys

protected Hashtable getParentKeys(javax.management.ObjectName 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

getNextNotificationSequenceNumber

protected long getNextNotificationSequenceNumber()
The getNextNotificationSequenceNumber method returns the next sequence number for use in notifications.

Returns:
a long value


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.