|
XMOJO 5 API Docs | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.adventnet.jmx.DefaultDynamicMBean
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.
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 |
public MBeanInfo mbeanInfo
public java.lang.Object object
public java.lang.Class clazz
public java.lang.Class iclazz
public java.lang.reflect.Method[] superInterfaceMeths
public java.util.Vector readMeths
public java.util.Vector writeMeths
public java.util.Vector isIsMeths
Constructor Detail |
public DefaultDynamicMBean(java.lang.Object object) throws java.lang.Exception
Method Detail |
public java.lang.Object getStandardMBeanObject()
protected void makeMBeanInfo() throws java.lang.Exception
public MBeanConstructorInfo[] getConstructors()
public MBeanOperationInfo[] getOperations()
public MBeanNotificationInfo[] getNotifications()
public MBeanInfo getMBeanInfo()
DynamicMBean
getMBeanInfo
in interface DynamicMBean
javax.management.DynamicMBean
MBeanInfo
allowing all attributes
and actions exposed by this Dynamic MBean to be retrieved.public java.lang.Object getAttribute(java.lang.String attribute) throws AttributeNotFoundException, MBeanException, ReflectionException
DynamicMBean
getAttribute
in interface DynamicMBean
javax.management.DynamicMBean
attribute
- - The name of the attribute to be retrievedAttributeNotFoundException
- - 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.public AttributeList getAttributes(java.lang.String[] attributes)
DynamicMBean
getAttributes
in interface DynamicMBean
javax.management.DynamicMBean
attributes
- A list of the attributes to be retrieved.public java.lang.Object invoke(java.lang.String actionName, java.lang.Object[] params, java.lang.String[] signature) throws MBeanException, ReflectionException
DynamicMBean
invoke
in interface DynamicMBean
javax.management.DynamicMBean
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.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 methodpublic void setAttribute(Attribute attribute) throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException
DynamicMBean
setAttribute
in interface DynamicMBean
javax.management.DynamicMBean
attribute
- - The identification of the attribute to be set and
the value it is to be set to.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.public AttributeList setAttributes(AttributeList attributes)
DynamicMBean
setAttributes
in interface DynamicMBean
javax.management.DynamicMBean
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.public void addNotificationListener(NotificationListener listener, NotificationFilter filter, java.lang.Object handback) throws java.lang.IllegalArgumentException
NotificationBroadcaster
addNotificationListener
in interface NotificationBroadcaster
javax.management.NotificationBroadcaster
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.java.lang.IllegalArgumentException
- Listener parameter is null.public void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException
NotificationBroadcaster
removeNotificationListener
in interface NotificationBroadcaster
javax.management.NotificationBroadcaster
listener
- The listener object which will handles notifications
emitted by the registered MBean.ListenerNotFoundException
- The listener is not registered in the MBean.public MBeanNotificationInfo[] getNotificationInfo()
NotificationBroadcaster
getNotificationInfo
in interface NotificationBroadcaster
javax.management.NotificationBroadcaster
public boolean isNotificationEnabled(Notification notification)
NotificationFilter
isNotificationEnabled
in interface NotificationFilter
javax.management.NotificationFilter
notification
- The notification to be sent.true
if the notification has to be sent to
the listener, false
otherwise.public void handleNotification(Notification notification, java.lang.Object handback)
NotificationListener
handleNotification
in interface NotificationListener
javax.management.NotificationListener
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.public ObjectName preRegister(MBeanServer server, ObjectName name) throws java.lang.Exception
MBeanRegistration
preRegister
in interface MBeanRegistration
javax.management.MBeanRegistration
server
- The MBean server in which the MBean will be registered.name
- The object name of the MBean.java.lang.Exception
- This exception should be caught by the MBean server
and re-thrown as an MBeanRegistrationException
.public void postRegister(java.lang.Boolean registrationDone)
MBeanRegistration
postRegister
in interface MBeanRegistration
javax.management.MBeanRegistration
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.public void preDeregister() throws java.lang.Exception
MBeanRegistration
preDeregister
in interface MBeanRegistration
javax.management.MBeanRegistration
java.lang.Exception
- This exception should be caught by the MBean server
and re-thrown as an MBeanRegistrationException
.public void postDeregister()
MBeanRegistration
postDeregister
in interface MBeanRegistration
|
XMOJO 5 API Docs | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |