Java Reference
In-Depth Information
The MBeanInfo class is the container for other objects that describe portions
of the MBean's management interface. The MBeanInfo class and the classes it
contains are collectively called MBean metadata classes.
The MBean metadata classes are created by Dynamic MBeans and also by the
MBean server. The MBean server uses these objects internally in order for it to
treat all MBeans equally regardless of the MBean type. In the case of Standard
MBeans, the MBean server uses introspection to create a set of metadata objects
that describe an MBean's management interface. For other MBeans (like the
Dynamic MBean), the metadata objects are constructed by the MBean itself.
This section breaks down the MBeanInfo object and explains how Dynamic
MBeans use it to provide a description of their exposed management interface.
5.3.1
Metadata of the MBeanInfo class
The MBeanInfo class is a standard JMX class containing classes that describe indi-
vidual parts of the overall management interface. Recall from chapter 4 that
management interfaces consist of exposed constructors, attributes, operations,
and optional notifications. The MBeanInfo contains a metadata object for each of
these parts. The following sections describe these metadata classes.
Table 5.2 identifies each metadata class and its corresponding management
interface part.
Table 5.2 The metadata classes and the parts of a management interface they rep-
resent. These classes are contained in the MBeanInfo object that is the return value
for the getMBeanInfo() method of the DynamicMBean interface.
Metadata class
Exposed part of the management interface
MBeanFeatureInfo
Super class to all other metadata classes
MBeanParameterInfo
Arguments passed to methods and constructors
MBeanConstructorInfo
Any exposed constructors
MBeanAttributeInfo
Readable and writable attributes
MBeanOperationInfo
Exposed MBean operations
MBeanNotificationInfo
The notifications an MBean can emit
In addition to containing the metadata objects, an instance of MBeanInfo provides
the class name and description of the MBean. You can get these values by invok-
ing the getClassName() method or the getDescription() method. In fact, all the
metadata classes contain a description member variable that describes the meta-
data object. When writing Dynamic MBeans, you should use this description
Search WWH ::




Custom Search