站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 management API Documentation 英文版文档

J2EEManagedObject (JBoss/Management API) - JBoss 4.0.1 sp1 management API Documentation 英文版文档


org.jboss.management.j2ee
Class J2EEManagedObject

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

public abstract class J2EEManagedObject
extends org.jboss.system.ServiceMBeanSupport
implements J2EEManagedObjectMBean, Serializable

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

Version:
$Revision: 1.27 $
Author:
Andreas Schaefer., Scott.Stark@jboss.org, thomas.diesler@jboss.org
See Also:
Serialized Form

Field Summary
static String NAME
           
static String TYPE
           
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport
log, server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.system.ServiceMBean
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
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)
           
 String getobjectName()
           
 javax.management.ObjectName getObjectName()
           
 javax.management.ObjectName getObjectName(javax.management.MBeanServer pServer, javax.management.ObjectName pName)
           
 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.
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 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()
           
 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.system.ServiceMBeanSupport
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
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jboss.system.ServiceMBean
getName, getState, getStateString, jbossInternalLifecycle
 
Methods inherited from interface org.jboss.system.Service
create, destroy, start, stop
 

Field Detail

TYPE

public static final String TYPE
See Also:
Constant Field Values

NAME

public static final String NAME
See Also:
Constant Field Values
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

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

getObjectName

public javax.management.ObjectName getObjectName(javax.management.MBeanServer pServer,
                                                 javax.management.ObjectName pName)

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

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

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


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