Package com.tangosol.net.management
Class AnnotatedStandardMBean
- java.lang.Object
-
- javax.management.StandardMBean
-
- com.tangosol.net.management.AnnotatedStandardMBean
-
- All Implemented Interfaces:
DynamicMBean,MBeanRegistration
public class AnnotatedStandardMBean extends StandardMBean
AnnotatedStandardMBean is an extension of aStandardMBeanthat uses theDescriptionannotation 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 "Adding information to a Standard MBean interface using annotations."
- Since:
- Coherence 3.7
- Author:
- cf 2010.12.10
-
-
Constructor Summary
Constructors Constructor Description AnnotatedStandardMBean(T impl, Class<T> clzIface)Make a DynamicMBean out of the MBean implementation, using the specified mbeanInterface class.AnnotatedStandardMBean(T impl, Class<T> clzIface, boolean isMXBean)Make a DynamicMBean out of the MBean implementation, using the specified mbeanInterface class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringgetDescription(MBeanAttributeInfo info)Retrieve a description for a particular attribute by finding aDescriptionannotation on the getter method for the attribute.protected StringgetDescription(MBeanInfo info)Retrieve the description for the MBean from the MBean interface annotation.protected StringgetDescription(MBeanOperationInfo info)Retrieve a description for the particularMBeanOperationInfoby finding aDescriptionannotation on the corresponding operation.protected StringgetParameterName(MBeanOperationInfo op, MBeanParameterInfo param, int iParam)Retrieve the parameter name for the specified parameter by finding aDescriptionannotation on the operation.-
Methods inherited from class javax.management.StandardMBean
cacheMBeanInfo, getAttribute, getAttributes, getCachedMBeanInfo, getClassName, getConstructors, getDescription, getDescription, getDescription, getDescription, getImpact, getImplementation, getImplementationClass, getMBeanInfo, getMBeanInterface, getParameterName, invoke, postDeregister, postRegister, preDeregister, preRegister, setAttribute, setAttributes, setImplementation
-
-
-
-
Constructor Detail
-
AnnotatedStandardMBean
public AnnotatedStandardMBean(T impl, Class<T> clzIface) throws NotCompliantMBeanExceptionMake a DynamicMBean out of the MBean implementation, using the specified mbeanInterface class.- Type Parameters:
T- the type of the MBean implementation- Parameters:
impl- 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 implementation- Throws:
NotCompliantMBeanException- if the mbeanInterface does not follow JMX design patterns for Management Interfaces, or if the provided implementation does not implement the specified interface
-
AnnotatedStandardMBean
public AnnotatedStandardMBean(T impl, Class<T> clzIface, boolean isMXBean) throws NotCompliantMBeanExceptionMake a DynamicMBean out of the MBean implementation, using the specified mbeanInterface class.- Type Parameters:
T- the type of the MBean implementation- Parameters:
impl- 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 implementationisMXBean- flag indicating whether clzIface represents an MXBean- Throws:
NotCompliantMBeanException- if the mbeanInterface does not follow JMX design patterns for Management Interfaces, or if the provided implementation does not implement the specified interface
-
-
Method Detail
-
getDescription
protected String getDescription(MBeanInfo info)
Retrieve the description for the MBean from the MBean interface annotation.- Overrides:
getDescriptionin classStandardMBean- Parameters:
info- theMBeanInfofor the MBean- Returns:
- the MBean description
-
getDescription
protected String getDescription(MBeanOperationInfo info)
Retrieve a description for the particularMBeanOperationInfoby finding aDescriptionannotation on the corresponding operation.- Overrides:
getDescriptionin classStandardMBean- Parameters:
info- theMBeanOperationInfo- Returns:
- the description for an operation
-
getDescription
protected String getDescription(MBeanAttributeInfo info)
Retrieve a description for a particular attribute by finding aDescriptionannotation on the getter method for the attribute. If a description is not found on the getter method, the setter will be checked.- Overrides:
getDescriptionin classStandardMBean- Parameters:
info- theMBeanAttributeInfofor the attribute- Returns:
- the description for an attribute
-
getParameterName
protected String getParameterName(MBeanOperationInfo op, MBeanParameterInfo param, int iParam)
Retrieve the parameter name for the specified parameter by finding aDescriptionannotation on the operation.- Overrides:
getParameterNamein classStandardMBean- Parameters:
op- theMBeanOperationInfofor the opparam- theMBeanParameterInfofor the parameteriParam- zero-based sequence number of the parameter- Returns:
- the name to use for the given MBeanParameterInfo.
-
-