Using Annotations to Provide MBean Information

The com.adobe.granite.jmx.annotation package provides several annotations and classes for easily providing MBean metadata to the JMX console. Use these annotations and classes instead of adding information to the MBean’s MBeanInfo object directly.

Annotations

Add annotations to the management interface to specify MBean metadata. The information appears in the JMX console for each implementation class that is deployed. The following annotations are available (for complete information, see the com.adobe.granite.jmx.annotation JavaDocs):

  • Description: Provides a description of the MBean class or method. When used on the class declaration, the desctiption appears on the JMX Console page for the MBean. When used on a method, the desctiption appears as hover text for the corresponding attribute or operation.

  • Impact: The impact of a method. Valid parameter values are the fields defined by javax.management.MBeanOperationInfo.

  • Name: Specifies the name to display for an operation parameter. Use this annotation to override the actual name of the method parameter that is used in the interface.

  • OpenTypeInfo: Specifies the class to use for representing composite data or tabular data in the JMX Console. For use with Open MBeans

  • TabularTypeInfo: Used to annotate the class that is used to represent tabular data.

Classes

Classes are provided for creating Dynamic MBeans that consume the annotations that you add to their interfaces:

  • AnnotatedStandardMBean: A subclass of the javax.management.StandardMBean class that automatically provides the JMX Console with the annotation metadata.
  • OpenAnnotatedStandardMBean: A subclass of the AnnotatedStandardMBean class for creating Open Mbeans that consume the OpenTypeInfo annoatation…