org.jboss.management.mejb
Class ManagementBean

java.lang.Object
  extended byorg.jboss.management.mejb.ManagementBean
All Implemented Interfaces:
EnterpriseBean (src) , java.io.Serializable, SessionBean (src)

public class ManagementBean
extends java.lang.Object
implements SessionBean (src)

Management Session Bean to enable the client to manage the server its is deployed on. This is the implementation of the JSR-77 specification MEJB.

See Also:
Serialized Form

Constructor Summary
ManagementBean()
           
 
Method Summary
 void addNotificationListener(ObjectName (src)  pBroadcaster, ObjectName (src)  pListener, NotificationFilter (src)  pFilter, java.lang.Object pHandback)
           
 ObjectInstance (src) createMBean(java.lang.String pClass, ObjectName (src)  pName, java.lang.Object[] pParameters, java.lang.String[] pSignature)
           
 void ejbActivate()
          The activate method is called when the instance is activated from its "passive" state.
 void ejbCreate()
          Create the Session Bean which takes the first available MBeanServer as target server
 void ejbPassivate()
          The passivate method is called before the instance enters the "passive" state.
 void ejbRemove()
          A container invokes this method before it ends the life of the session object.
 java.lang.Object getAttribute(ObjectName (src)  pName, java.lang.String pAttribute)
           
 AttributeList (src) getAttributes(ObjectName (src)  pName, java.lang.String[] pAttributes)
           
 java.lang.String getDefaultDomain()
           
 ListenerRegistration (src) getListenerRegistry()
           
 java.lang.Integer getMBeanCount()
           
 MBeanInfo (src) getMBeanInfo(ObjectName (src)  pName)
           
 java.lang.Object invoke(ObjectName (src)  pName, java.lang.String pOperationName, java.lang.Object[] pParams, java.lang.String[] pSignature)
           
 boolean isRegistered(ObjectName (src)  pName)
           
 java.util.Set queryNames(ObjectName (src)  pName, QueryExp (src)  pQuery)
           
 void removeNotificationListener(ObjectName (src)  pBroadcaster, ObjectName (src)  pListener)
           
 void setAttribute(ObjectName (src)  pName, Attribute (src)  pAttribute)
           
 AttributeList (src) setAttributes(ObjectName (src)  pName, AttributeList (src)  pAttributes)
           
 void setSessionContext(SessionContext (src)  aContext)
          Set the associated session context.
 java.lang.String toString()
          Describes the instance and its content for debugging purpose
 void unregisterMBean(ObjectName (src)  pName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ManagementBean

public ManagementBean()
Method Detail

getAttribute

public java.lang.Object getAttribute(ObjectName (src)  pName,
                                     java.lang.String pAttribute)
                              throws MBeanException (src) ,
                                     AttributeNotFoundException (src) ,
                                     InstanceNotFoundException (src) ,
                                     ReflectionException (src) ,
                                     java.rmi.RemoteException
Throws:
java.rmi.RemoteException - Necessary for a EJB
MBeanException (src)
AttributeNotFoundException (src)
InstanceNotFoundException (src)
ReflectionException (src)

getAttributes

public AttributeList (src)  getAttributes(ObjectName (src)  pName,
                                   java.lang.String[] pAttributes)
                            throws InstanceNotFoundException (src) ,
                                   ReflectionException (src) ,
                                   java.rmi.RemoteException
Throws:
java.rmi.RemoteException - Necessary for a EJB
InstanceNotFoundException (src)
ReflectionException (src)

getDefaultDomain

public java.lang.String getDefaultDomain()
                                  throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException - Necessary for a EJB

getMBeanCount

public java.lang.Integer getMBeanCount()
                                throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException - Necessary for a EJB

getMBeanInfo

public MBeanInfo (src)  getMBeanInfo(ObjectName (src)  pName)
                       throws IntrospectionException (src) ,
                              InstanceNotFoundException (src) ,
                              ReflectionException (src) ,
                              java.rmi.RemoteException
Throws:
java.rmi.RemoteException - Necessary for a EJB
IntrospectionException (src)
InstanceNotFoundException (src)
ReflectionException (src)

getListenerRegistry

public ListenerRegistration (src)  getListenerRegistry()
                                         throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException - Necessary for a EJB

invoke

public java.lang.Object invoke(ObjectName (src)  pName,
                               java.lang.String pOperationName,
                               java.lang.Object[] pParams,
                               java.lang.String[] pSignature)
                        throws InstanceNotFoundException (src) ,
                               MBeanException (src) ,
                               ReflectionException (src) ,
                               java.rmi.RemoteException
Throws:
java.rmi.RemoteException - Necessary for a EJB
InstanceNotFoundException (src)
MBeanException (src)
ReflectionException (src)

isRegistered

public boolean isRegistered(ObjectName (src)  pName)
                     throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException - Necessary for a EJB

queryNames

public java.util.Set queryNames(ObjectName (src)  pName,
                                QueryExp (src)  pQuery)
                         throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException - Necessary for a EJB

setAttribute

public void setAttribute(ObjectName (src)  pName,
                         Attribute (src)  pAttribute)
                  throws AttributeNotFoundException (src) ,
                         InstanceNotFoundException (src) ,
                         InvalidAttributeValueException (src) ,
                         MBeanException (src) ,
                         ReflectionException (src) ,
                         java.rmi.RemoteException
Throws:
java.rmi.RemoteException - Necessary for a EJB
AttributeNotFoundException (src)
InstanceNotFoundException (src)
InvalidAttributeValueException (src)
MBeanException (src)
ReflectionException (src)

setAttributes

public AttributeList (src)  setAttributes(ObjectName (src)  pName,
                                   AttributeList (src)  pAttributes)
                            throws InstanceNotFoundException (src) ,
                                   ReflectionException (src) ,
                                   java.rmi.RemoteException
Throws:
java.rmi.RemoteException - Necessary for a EJB
InstanceNotFoundException (src)
ReflectionException (src)

createMBean

public ObjectInstance (src)  createMBean(java.lang.String pClass,
                                  ObjectName (src)  pName,
                                  java.lang.Object[] pParameters,
                                  java.lang.String[] pSignature)
                           throws InstanceAlreadyExistsException (src) ,
                                  MBeanException (src) ,
                                  MBeanRegistrationException (src) ,
                                  NotCompliantMBeanException (src) ,
                                  ReflectionException (src) ,
                                  java.rmi.RemoteException
Throws:
java.rmi.RemoteException - Necessary for a EJB
InstanceAlreadyExistsException (src)
MBeanException (src)
MBeanRegistrationException (src)
NotCompliantMBeanException (src)
ReflectionException (src)

unregisterMBean

public void unregisterMBean(ObjectName (src)  pName)
                     throws InstanceNotFoundException (src) ,
                            MBeanRegistrationException (src) ,
                            java.rmi.RemoteException
Throws:
java.rmi.RemoteException - Necessary for a EJB
InstanceNotFoundException (src)
MBeanRegistrationException (src)

addNotificationListener

public void addNotificationListener(ObjectName (src)  pBroadcaster,
                                    ObjectName (src)  pListener,
                                    NotificationFilter (src)  pFilter,
                                    java.lang.Object pHandback)
                             throws InstanceNotFoundException (src) ,
                                    java.rmi.RemoteException
Throws:
java.rmi.RemoteException - Necessary for a EJB
InstanceNotFoundException (src)

removeNotificationListener

public void removeNotificationListener(ObjectName (src)  pBroadcaster,
                                       ObjectName (src)  pListener)
                                throws InstanceNotFoundException (src) ,
                                       ListenerNotFoundException (src) ,
                                       java.rmi.RemoteException
Throws:
java.rmi.RemoteException - Necessary for a EJB
InstanceNotFoundException (src)
ListenerNotFoundException (src)

ejbCreate

public void ejbCreate()
               throws CreateException (src) 
Create the Session Bean which takes the first available MBeanServer as target server

Throws:
CreateException (src)

toString

public java.lang.String toString()
Describes the instance and its content for debugging purpose

Returns:
Debugging information about the instance and its content

setSessionContext

public void setSessionContext(SessionContext (src)  aContext)
                       throws EJBException (src) 
Set the associated session context. The container invokes this method on an instance after the instance has been created.

This method is called with no transaction context.

Specified by:
setSessionContext in interface SessionBean (src)
Parameters:
aContext - A SessionContext interface for the instance. The instance should store the reference to the context in an instance variable.
Throws:
EJBException (src) - Should something go wrong while seting the context, an EJBException will be thrown.

ejbActivate

public void ejbActivate()
                 throws EJBException (src) 
The activate method is called when the instance is activated from its "passive" state. The instance should acquire any resource that it has released earlier in the ejbPassivate() method.

This method is called with no transaction context.

Specified by:
ejbActivate in interface SessionBean (src)
Throws:
EJBException (src) - Thrown by the method to indicate a failure caused by a system-level error

ejbPassivate

public void ejbPassivate()
                  throws EJBException (src) 
The passivate method is called before the instance enters the "passive" state. The instance should release any resources that it can re-acquire later in the ejbActivate() method.

After the passivate method completes, the instance must be in a state that allows the container to use the Java Serialization protocol to externalize and store away the instance's state.

This method is called with no transaction context.

Specified by:
ejbPassivate in interface SessionBean (src)
Throws:
EJBException (src) - Thrown by the method to indicate a failure caused by a system-level error

ejbRemove

public void ejbRemove()
               throws EJBException (src) 
A container invokes this method before it ends the life of the session object. This happens as a result of a client's invoking a remove operation, or when a container decides to terminate the session object after a timeout.

This method is called with no transaction context.

Specified by:
ejbRemove in interface SessionBean (src)
Throws:
EJBException (src) - Thrown by the method to indicate a failure caused by a system-level error