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

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


org.jboss.management.j2ee
Class MBean

java.lang.Object
  extended byorg.jboss.mx.util.JBossNotificationBroadcasterSupport
      extended byorg.jboss.system.ServiceMBeanSupport
          extended byorg.jboss.management.j2ee.J2EEManagedObject
              extended byorg.jboss.management.j2ee.MBean
All Implemented Interfaces:
EventProvider, J2EEManagedObjectMBean, MBeanMBean, javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, Serializable, org.jboss.system.Service, org.jboss.system.ServiceMBean, StateManageable

public class MBean
extends J2EEManagedObject
implements MBeanMBean

Root class of the JBoss implementation of a custom MBean managed object.

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

Field Summary
 
Fields inherited from class org.jboss.management.j2ee.J2EEManagedObject
NAME, TYPE
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport
server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.management.j2ee.StateManageable
CREATED, DESTROYED, FAILED, REGISTERED, RUNNING, STARTING, STOPPED, STOPPING, UNREGISTERED
 
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
MBean(String pName, javax.management.ObjectName pServiceModule, javax.management.ObjectName pTarget)
           
 
Method Summary
static javax.management.ObjectName create(javax.management.MBeanServer pServer, String pServiceModule, javax.management.ObjectName pTarget)
          Create a
static void destroy(javax.management.MBeanServer pServer, String pName)
           
 String getEventType(int pIndex)
          Returns the given Type of Events it emits according to its index in the list
 String[] getEventTypes()
           
protected  Hashtable getParentKeys(javax.management.ObjectName pParent)
          This method can be overwritten by any subclass which must return <parent-j2eeType> indicating its parents.
 long getStartTime()
           
 int getState()
           
 String getStateString()
           
 boolean isstateMonitored()
          Does the MBean monitor state changes of the JBoss MBean service.
 void mejbStart()
          Starts this SMO which can only be invoked when the SMO is in the State stopped.
 void mejbStartRecursive()
          Starts this SMO like @start start().
 void mejbStop()
          Stops this SMO which can only be into the running or starting.
 void postCreation()
           
 void preDestruction()
           
 String toString()
           
 
Methods inherited from class org.jboss.management.j2ee.J2EEManagedObject
addChild, getobjectName, getObjectName, getObjectName, getparent, getType, getType, iseventProvider, isstateManageable, isstatisticsProvider, newObjectName, postRegister, preDeregister, removeChild, removeObject, removeObject, sendNotification, setparent
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport
create, createService, destroy, destroyService, getLog, getName, getNextNotificationSequenceNumber, getServer, getServiceName, 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.management.j2ee.J2EEManagedObjectMBean
addChild, getobjectName, getparent, iseventProvider, isstateManageable, isstatisticsProvider, removeChild, setparent
 
Methods inherited from interface org.jboss.system.ServiceMBean
getName, jbossInternalLifecycle
 
Methods inherited from interface org.jboss.system.Service
create, destroy, start, stop
 

Constructor Detail

MBean

public MBean(String pName,
             javax.management.ObjectName pServiceModule,
             javax.management.ObjectName pTarget)
      throws javax.management.MalformedObjectNameException,
             InvalidParentException
Parameters:
pName - Name of the MBean
Method Detail

create

public static javax.management.ObjectName create(javax.management.MBeanServer pServer,
                                                 String pServiceModule,
                                                 javax.management.ObjectName pTarget)
Create a

Parameters:
pServer -
pServiceModule -
pTarget -
Returns:

destroy

public static void destroy(javax.management.MBeanServer pServer,
                           String pName)

isstateMonitored

public boolean isstateMonitored()
Does the MBean monitor state changes of the JBoss MBean service.

Specified by:
isstateMonitored in interface MBeanMBean
Returns:
True if the underlying JBoss MBean service is monitored for state changes.

postCreation

public void postCreation()
Overrides:
postCreation in class J2EEManagedObject

preDestruction

public void preDestruction()
Overrides:
preDestruction in class J2EEManagedObject

getEventTypes

public String[] getEventTypes()
Specified by:
getEventTypes in interface EventProvider
Returns:
The actual list of Types of Events this Managed Object emits. The list is never null nor empty

getEventType

public String getEventType(int pIndex)
Description copied from interface: EventProvider
Returns the given Type of Events it emits according to its index in the list

Specified by:
getEventType in interface EventProvider
Parameters:
pIndex - Index of the requested Event Type
Returns:
Event Type if given Index is within the boundaries otherwise null

getStartTime

public long getStartTime()
Specified by:
getStartTime in interface StateManageable
Returns:
The Time (in milliseconds since 1/1/1970 00:00:00) that this managed object was started

getState

public int getState()
Specified by:
getState in interface StateManageable

getStateString

public String getStateString()
Specified by:
getStateString in interface StateManageable

mejbStart

public void mejbStart()
Description copied from interface: StateManageable
Starts this SMO which can only be invoked when the SMO is in the State stopped. The SMO will go into the State @STARTING started and after it completes successfully the SMO will go to the State running. The children of the SMO will not be started by this method call.

Attention: According to the specification this is named start() but in order to avoid name conflicts this is renamed to mejbStart(). The MEJB interface will make the conversion from start to mejbStart to make it transparent to the client.

Specified by:
mejbStart in interface StateManageable

mejbStartRecursive

public void mejbStartRecursive()
Description copied from interface: StateManageable
Starts this SMO like @start start(). After the SMO is started all its children in the State of @STOPPED stopped theirs startRecursive() are started too.

Attention: According to the specification this is named startRecursive() but in order to avoid name conflicts this is renamed to mejbStartRecursive(). The MEJB interface will make the conversion from startRecursive to mejbStartRecursive to make it transparent to the client.

Specified by:
mejbStartRecursive in interface StateManageable

mejbStop

public void mejbStop()
Description copied from interface: StateManageable
Stops this SMO which can only be into the running or starting. The State will change to stoping and after it completes successfully it will go into the State stopped. Afterwards all its children stop() method is called.

Attention: According to the specification this is named stop() but in order to avoid name conflicts this is renamed to mejbStop(). The MEJB interface will make the conversion from stop to mejbStop to make it transparent to the client.

Specified by:
mejbStop in interface StateManageable

toString

public String toString()
Overrides:
toString in class J2EEManagedObject

getParentKeys

protected Hashtable getParentKeys(javax.management.ObjectName pParent)
Description copied from class: J2EEManagedObject
This method can be overwritten by any subclass which must return <parent-j2eeType> indicating its parents. By default it returns an empty hashtable instance.

Overrides:
getParentKeys in class J2EEManagedObject
Parameters:
pParent - The direct parent of this class
Returns:
A hashtable with the SAR-Module, J2EE-Application and J2EE-Server as parent


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