public class EasyBeanWrapper
extends java.lang.Object
implements javax.management.DynamicMBean
EasyBeanNotificationWrapper
Constructor and Description |
---|
EasyBeanWrapper(java.lang.Object bean) |
EasyBeanWrapper(java.lang.Object bean,
EasyBeanExposure exposure) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getAttribute(java.lang.String attribute) |
javax.management.AttributeList |
getAttributes(java.lang.String[] attributes) |
javax.management.MBeanInfo |
getMBeanInfo() |
java.lang.Object |
invoke(java.lang.String actionName,
java.lang.Object[] params,
java.lang.String[] signature) |
void |
register()
Registers this MBean with the platform MBeanServer
|
void |
register(javax.management.MBeanServer mBeanServer)
Registers this MBean with the given MBeanServer.
|
void |
setAttribute(javax.management.Attribute attribute) |
javax.management.AttributeList |
setAttributes(javax.management.AttributeList attributes) |
void |
unregister()
Unregisters this MBean from the platform MBeanServer
|
void |
unregister(javax.management.MBeanServer mBeanServer)
Unregisters this MBean from the given MBeanServer
*
|
public EasyBeanWrapper(java.lang.Object bean) throws InvalidEasyBeanNameException, InvalidEasyBeanAnnotation, InvalidEasyBeanOpenType
bean
- The bean to wrap as a DynamicMBean.InvalidEasyBeanNameException
- If the ObjectName used for this bean in invalid.InvalidEasyBeanAnnotation
- If an EasyBean annotation is used incorrectly.InvalidEasyBeanOpenType
- If the given object (or a descendant of this object) cannot be mapped to an OpenType.public EasyBeanWrapper(java.lang.Object bean, EasyBeanExposure exposure) throws InvalidEasyBeanNameException, InvalidEasyBeanAnnotation, InvalidEasyBeanOpenType
bean
- The bean to wrap as a DynamicMBean.exposure
- Overrides the EasyBeanExposure annotated by the given bean object.InvalidEasyBeanNameException
- If the ObjectName used for this bean in invalid.InvalidEasyBeanAnnotation
- If an EasyBean annotation is used incorrectly.InvalidEasyBeanOpenType
- If the given object (or a descendant of this object) cannot be mapped to an OpenType.public void register() throws ObjectNameAlreadyRegistered, UnexpectedEasyBeanException
ObjectNameAlreadyRegistered
- If the object name of this MBean has already been registered.UnexpectedEasyBeanException
- If the registration could not occur from some other unexpected reason.ManagementFactory.getPlatformMBeanServer()
public void register(javax.management.MBeanServer mBeanServer) throws ObjectNameAlreadyRegistered, UnexpectedEasyBeanException
mBeanServer
- The server to register this MBean with.ObjectNameAlreadyRegistered
- If the object name of this MBean has already been registered.UnexpectedEasyBeanException
- If the registration could not occur from some other unexpected reason.public void unregister() throws UnexpectedEasyBeanException
UnexpectedEasyBeanException
- If the unregister action could not occur from some other unexpected reason.ManagementFactory.getPlatformMBeanServer()
public void unregister(javax.management.MBeanServer mBeanServer) throws UnexpectedEasyBeanException
mBeanServer
- The server to unregister this MBean from.UnexpectedEasyBeanException
- If the unregister action could not occur from some other unexpected reason.public java.lang.Object getAttribute(java.lang.String attribute) throws javax.management.AttributeNotFoundException, javax.management.MBeanException, javax.management.ReflectionException
getAttribute
in interface javax.management.DynamicMBean
javax.management.AttributeNotFoundException
javax.management.MBeanException
javax.management.ReflectionException
public javax.management.AttributeList getAttributes(java.lang.String[] attributes)
getAttributes
in interface javax.management.DynamicMBean
public javax.management.MBeanInfo getMBeanInfo()
getMBeanInfo
in interface javax.management.DynamicMBean
DynamicMBean.getMBeanInfo()
public java.lang.Object invoke(java.lang.String actionName, java.lang.Object[] params, java.lang.String[] signature) throws javax.management.MBeanException, javax.management.ReflectionException
invoke
in interface javax.management.DynamicMBean
javax.management.MBeanException
javax.management.ReflectionException
DynamicMBean.invoke(String, Object[], String[])
public void setAttribute(javax.management.Attribute attribute) throws javax.management.AttributeNotFoundException, javax.management.InvalidAttributeValueException, javax.management.MBeanException, javax.management.ReflectionException
setAttribute
in interface javax.management.DynamicMBean
javax.management.AttributeNotFoundException
javax.management.InvalidAttributeValueException
javax.management.MBeanException
javax.management.ReflectionException
DynamicMBean.setAttribute(javax.management.Attribute)
public javax.management.AttributeList setAttributes(javax.management.AttributeList attributes)
setAttributes
in interface javax.management.DynamicMBean
DynamicMBean.setAttributes(javax.management.AttributeList)