XMOJO 5 API Docs

com.adventnet.jmx
Class DefaultDynamicMBean

java.lang.Object
  |
  +--com.adventnet.jmx.DefaultDynamicMBean
All Implemented Interfaces:
DynamicMBean, java.util.EventListener, MBeanRegistration, NotificationBroadcaster, NotificationFilter, NotificationListener, java.io.Serializable

public class DefaultDynamicMBean
extends java.lang.Object
implements DynamicMBean, NotificationBroadcaster, NotificationListener, NotificationFilter, MBeanRegistration

This class acts as the wrapper dynamic mbean for standard mbeans that intends to register with the MBeanServer. This class gets instantiated from the server's registerMBean method, whenever the incoming object is a standard mbean.

See Also:
Serialized Form

Field Summary
 java.lang.Class clazz
           
 java.lang.Class iclazz
           
 java.util.Vector isIsMeths
           
 MBeanInfo mbeanInfo
           
 java.lang.Object object
           
 java.util.Vector readMeths
           
 java.lang.reflect.Method[] superInterfaceMeths
           
 java.util.Vector writeMeths
           
 
Constructor Summary
DefaultDynamicMBean(java.lang.Object object)
           
 
Method Summary
 void addNotificationListener(NotificationListener listener, NotificationFilter filter, java.lang.Object handback)
          Enables a couple (listener,handback) for a registered MBean to be added.
 java.lang.Object getAttribute(java.lang.String attribute)
          Obtains the value of a specific attribute of the Dynamic MBean.
 AttributeList getAttributes(java.lang.String[] attributes)
          Enables the values of several attributes of the Dynamic MBean.
 MBeanConstructorInfo[] getConstructors()
           
 MBeanInfo getMBeanInfo()
          Provides the exposed attributes and actions of the Dynamic MBean using an MBeanInfo object.
 MBeanNotificationInfo[] getNotificationInfo()
          Returns a NotificationInfo object containing the name of the Java class of the notification and the notification types sent.
 MBeanNotificationInfo[] getNotifications()
           
 MBeanOperationInfo[] getOperations()
           
 java.lang.Object getStandardMBeanObject()
           
 void handleNotification(Notification notification, java.lang.Object handback)
          Invoked when a JMX notification occurs.
 java.lang.Object invoke(java.lang.String actionName, java.lang.Object[] params, java.lang.String[] signature)
          Allows an action to be invoked on the Dynamic MBean.
 boolean isNotificationEnabled(Notification notification)
          Invoked before sending the specified notification to the listener.
protected  void makeMBeanInfo()
           
 void postDeregister()
          Allows the MBean to perform any operations needed after having been de-registered in the MBeanServer.
 void postRegister(java.lang.Boolean registrationDone)
          Allows the MBean to perform any operations needed after having been registered in the MBean server or after the registration has failed.
 void preDeregister()
          Allows the MBean to perform any operations it needs before being de-registered by the MBean server.
 ObjectName preRegister(MBeanServer server, ObjectName name)
          Allows the MBean to perform any operations it needs before being registered in the MBean server.
 void removeNotificationListener(NotificationListener listener)
          Enables a listener for an MBean to be removed.
 void setAttribute(Attribute attribute)
          Sets the value of a specific attribute of the Dynamic MBean.
 AttributeList setAttributes(AttributeList attributes)
          Sets the values of several attributes of the Dynamic MBean.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mbeanInfo

public MBeanInfo mbeanInfo

object

public java.lang.Object object

clazz

public java.lang.Class clazz

iclazz

public java.lang.Class iclazz

superInterfaceMeths

public java.lang.reflect.Method[] superInterfaceMeths

readMeths

public java.util.Vector readMeths

writeMeths

public java.util.Vector writeMeths

isIsMeths

public java.util.Vector isIsMeths
Constructor Detail

DefaultDynamicMBean

public DefaultDynamicMBean(java.lang.Object object)
                    throws java.lang.Exception
Method Detail

getStandardMBeanObject

public java.lang.Object getStandardMBeanObject()

makeMBeanInfo

protected void makeMBeanInfo()
                      throws java.lang.Exception

getConstructors

public MBeanConstructorInfo[] getConstructors()

getOperations

public MBeanOperationInfo[] getOperations()

getNotifications

public MBeanNotificationInfo[] getNotifications()

getMBeanInfo

public MBeanInfo getMBeanInfo()
Description copied from interface: DynamicMBean
Provides the exposed attributes and actions of the Dynamic MBean using an MBeanInfo object.
Specified by:
getMBeanInfo in interface DynamicMBean
Following copied from interface: javax.management.DynamicMBean
Returns:
An instance of MBeanInfo allowing all attributes and actions exposed by this Dynamic MBean to be retrieved.

getAttribute

public java.lang.Object getAttribute(java.lang.String attribute)
                              throws AttributeNotFoundException,
                                     MBeanException,
                                     ReflectionException
Description copied from interface: DynamicMBean
Obtains the value of a specific attribute of the Dynamic MBean.
Specified by:
getAttribute in interface DynamicMBean
Following copied from interface: javax.management.DynamicMBean
Parameters:
attribute - - The name of the attribute to be retrieved
Returns:
The value of the attribute retrieved.
Throws:
AttributeNotFoundException - - The specified attribute does not exist or cannot be retrieved.
MBeanException - - Wraps a java.lang.Exception thrown by the MBean's getter.
ReflectionException - - Wraps a java.lang.Exception thrown while trying to invoke the getter.

getAttributes

public AttributeList getAttributes(java.lang.String[] attributes)
Description copied from interface: DynamicMBean
Enables the values of several attributes of the Dynamic MBean.
Specified by:
getAttributes in interface DynamicMBean
Following copied from interface: javax.management.DynamicMBean
Parameters:
attributes - A list of the attributes to be retrieved.
Returns:
The list of attributes retrieved.

invoke

public java.lang.Object invoke(java.lang.String actionName,
                               java.lang.Object[] params,
                               java.lang.String[] signature)
                        throws MBeanException,
                               ReflectionException
Description copied from interface: DynamicMBean
Allows an action to be invoked on the Dynamic MBean.
Specified by:
invoke in interface DynamicMBean
Following copied from interface: javax.management.DynamicMBean
Parameters:
actionName - - The name of the action to be invoked.
params - - An array containing the parameters to be set when the action is invoked.
signature - - An array containing the signature of the action. The class objects will be loaded through the same class loader as the one used for loading the MBean on which the action is invoked.
Returns:
The object returned by the action, which represents the result of invoking the action on the MBean specified.
Throws:
MBeanException - - Wraps a java.lang.Exception thrown by the MBean's invoked method.
ReflectionException - - Wraps a java.lang.Exception thrown while trying to invoke the method

setAttribute

public void setAttribute(Attribute attribute)
                  throws AttributeNotFoundException,
                         InvalidAttributeValueException,
                         MBeanException,
                         ReflectionException
Description copied from interface: DynamicMBean
Sets the value of a specific attribute of the Dynamic MBean.
Specified by:
setAttribute in interface DynamicMBean
Following copied from interface: javax.management.DynamicMBean
Parameters:
attribute - - The identification of the attribute to be set and the value it is to be set to.
Throws:
AttributeNotFoundException - - The specified attribute does not exist or cannot be retrieved.
InvalidAttributeValueException - - The specified value is not a valid value for the attribute.
MBeanException - - Wraps a java.lang.Exception thrown by the MBean's setter.
ReflectionException - - Wraps a java.lang.Exception thrown while trying to invoke the MBean's setter.

setAttributes

public AttributeList setAttributes(AttributeList attributes)
Description copied from interface: DynamicMBean
Sets the values of several attributes of the Dynamic MBean.
Specified by:
setAttributes in interface DynamicMBean
Following copied from interface: javax.management.DynamicMBean
Parameters:
name - The object name of the MBean within which the attributes are to be set.
attributes - A list of attributes: The identification of the attributes to be set and the values they are to be set to.
Returns:
The list of attributes that were set, with their new values.

addNotificationListener

public void addNotificationListener(NotificationListener listener,
                                    NotificationFilter filter,
                                    java.lang.Object handback)
                             throws java.lang.IllegalArgumentException
Description copied from interface: NotificationBroadcaster
Enables a couple (listener,handback) for a registered MBean to be added.
Specified by:
addNotificationListener in interface NotificationBroadcaster
Following copied from interface: javax.management.NotificationBroadcaster
Parameters:
listener - The listener object which will handles notifications emitted by the registered MBean.
filter - The filter object. If not specified, no filtering will be performed before handling notifications.
handback - The context to be sent to the listener when a notification is emitted.
Throws:
java.lang.IllegalArgumentException - Listener parameter is null.

removeNotificationListener

public void removeNotificationListener(NotificationListener listener)
                                throws ListenerNotFoundException
Description copied from interface: NotificationBroadcaster
Enables a listener for an MBean to be removed. All couple (listener, handback) are removed.
Specified by:
removeNotificationListener in interface NotificationBroadcaster
Following copied from interface: javax.management.NotificationBroadcaster
Parameters:
listener - The listener object which will handles notifications emitted by the registered MBean.
Throws:
ListenerNotFoundException - The listener is not registered in the MBean.

getNotificationInfo

public MBeanNotificationInfo[] getNotificationInfo()
Description copied from interface: NotificationBroadcaster
Returns a NotificationInfo object containing the name of the Java class of the notification and the notification types sent.
Specified by:
getNotificationInfo in interface NotificationBroadcaster
Following copied from interface: javax.management.NotificationBroadcaster
Returns:
This returns a array of MBeanNotificationInfo which contains the notification information

isNotificationEnabled

public boolean isNotificationEnabled(Notification notification)
Description copied from interface: NotificationFilter
Invoked before sending the specified notification to the listener.
Specified by:
isNotificationEnabled in interface NotificationFilter
Following copied from interface: javax.management.NotificationFilter
Parameters:
notification - The notification to be sent.
Returns:
true if the notification has to be sent to the listener, false otherwise.

handleNotification

public void handleNotification(Notification notification,
                               java.lang.Object handback)
Description copied from interface: NotificationListener
Invoked when a JMX notification occurs. The implementation of this method should return as soon as possible, to avoid blocking its notification broadcaster.
Specified by:
handleNotification in interface NotificationListener
Following copied from interface: javax.management.NotificationListener
Parameters:
notification - The notification.
handback - An opaque object which helps the listener to associate information regarding the MBean emitter. This object is passed to the MBean during the addListener call and resent, without modification, to the listener. The MBean object should not use or modify the object.

preRegister

public ObjectName preRegister(MBeanServer server,
                              ObjectName name)
                       throws java.lang.Exception
Description copied from interface: MBeanRegistration
Allows the MBean to perform any operations it needs before being registered in the MBean server. If the name of the MBean is not specified, the MBean can provide a name for its registration. If any exception is raised, the MBean will not be registered in the MBean server.
Specified by:
preRegister in interface MBeanRegistration
Following copied from interface: javax.management.MBeanRegistration
Parameters:
server - The MBean server in which the MBean will be registered.
name - The object name of the MBean.
Returns:
The name of the MBean registered.
Throws:
java.lang.Exception - This exception should be caught by the MBean server and re-thrown as an MBeanRegistrationException.

postRegister

public void postRegister(java.lang.Boolean registrationDone)
Description copied from interface: MBeanRegistration
Allows the MBean to perform any operations needed after having been registered in the MBean server or after the registration has failed.
Specified by:
postRegister in interface MBeanRegistration
Following copied from interface: javax.management.MBeanRegistration
Parameters:
registrationDone - Indicates whether or not the MBean has been successfully registered in the MBean server. The value false means that the registration phase has failed.

preDeregister

public void preDeregister()
                   throws java.lang.Exception
Description copied from interface: MBeanRegistration
Allows the MBean to perform any operations it needs before being de-registered by the MBean server.
Specified by:
preDeregister in interface MBeanRegistration
Following copied from interface: javax.management.MBeanRegistration
Throws:
java.lang.Exception - This exception should be caught by the MBean server and re-thrown as an MBeanRegistrationException.

postDeregister

public void postDeregister()
Description copied from interface: MBeanRegistration
Allows the MBean to perform any operations needed after having been de-registered in the MBeanServer.
Specified by:
postDeregister in interface MBeanRegistration

XMOJO 5 API Docs

Copyright ©2003 XMOJO.org. All Rights Reserved.