public class AnnotatedStandardMBean extends StandardMBean
StandardMBean that uses the Description annotation for describing the attributes, operations and the bean on the designated MBean interface.
This class is an extended version of the implementation from Eamon McManus's java.net article
| Constructor and Description |
|---|
AnnotatedStandardMBean(T impl, Class<T> clzIface)
Make a DynamicMBean out of the MBean implementation, using the specified mbeanInterface class.
|
| Modifier and Type | Method and Description |
|---|---|
protected String |
getDescription(MBeanAttributeInfo info)
Retrieve a description for a particular attribute by finding a
Description annotation on the getter method for the attribute. |
protected String |
getDescription(MBeanInfo info)
Retrieve the description for the MBean from the MBean interface annotation.
|
protected String |
getDescription(MBeanOperationInfo info)
Retrieve a description for the particular
MBeanOperationInfo by finding a Description annotation on the corresponding operation. |
protected String |
getParameterName(MBeanOperationInfo op, MBeanParameterInfo param, int iParam)
Retrieve the parameter name for the specified parameter by finding a
Description annotation on the operation. |
cacheMBeanInfo, getAttribute, getAttributes, getCachedMBeanInfo, getClassName, getConstructors, getDescription, getDescription, getDescription, getDescription, getImpact, getImplementation, getImplementationClass, getMBeanInfo, getMBeanInterface, getParameterName, invoke, postDeregister, postRegister, preDeregister, preRegister, setAttribute, setAttributes, setImplementation
public AnnotatedStandardMBean(T impl,
Class<T> clzIface)
throws NotCompliantMBeanException
T - the type of the MBean implementationimpl - the implementation of the MBeanclzIface - the Management Interface implemented by the MBean's implementation. If null, then this object will use standard JMX design pattern to determine the management interface associated with the given implementationNotCompliantMBeanException - if the mbeanInterface does not follow JMX design patterns for Management Interfaces, or if the provided implementation does not implement the specified interfaceprotected String getDescription(MBeanInfo info)
getDescription in class StandardMBeaninfo - the MBeanInfo for the MBeanprotected String getDescription(MBeanOperationInfo info)
MBeanOperationInfo by finding a Description annotation on the corresponding operation.getDescription in class StandardMBeaninfo - the MBeanOperationInfoprotected String getDescription(MBeanAttributeInfo info)
Description annotation on the getter method for the attribute. If a description is not found on the getter method, the setter will be checked.getDescription in class StandardMBeaninfo - the MBeanAttributeInfo for the attributeprotected String getParameterName(MBeanOperationInfo op, MBeanParameterInfo param, int iParam)
Description annotation on the operation.getParameterName in class StandardMBeanop - the MBeanOperationInfo for the opparam - the MBeanParameterInfo for the parameteriParam - zero-based sequence number of the parameter