United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6204469 Add Descriptor support to all types of MBean
JDK-6204469 : Add Descriptor support to all types of MBean

Details
Type:
Enhancement
Submit Date:
2004-12-06
Status:
Resolved
Updated Date:
2010-07-29
Project Name:
JDK
Resolved Date:
2005-05-14
Component:
core-svc
OS:
generic
Sub-Component:
javax.management
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
6
Fixed Versions:

Related Reports
Duplicate:
Relates:
Relates:
Relates:
Relates:

Sub Tasks

Description
Today, Model MBeans support "Descriptors" to supply additional metadata about the MBean.  A Descriptor is essentially a Map<String,?> that contains metadata items.  A Descriptor can be attached to the ModelMBeanInfo to describe the MBean itself, and to the various ModelMBean*Info classes (ModelMBeanAttributeInfo etc) to describe the components of the MBean.

This feature is extremely useful, and in the original JMX API there was plainly some recognition of its usefulness beyond just Model MBeans.  The Descriptor interface is in javax.management, not javax.management.modelmbean, although its only standard implementation is javax.management.modelmbean.DescriptorSupport.

In particular, it would be very convenient to be able to extend the metadata of Open MBeans using Descriptors, for example in conjunction with MXBeans.

Model MBeans are somewhat difficult to code because they are Dynamic MBeans.  You need to build up a lot of data structures to specify the metadata of the Model MBean.  If Descriptors were available to Standard MBeans, and if their contents were specifiable through annotations, this would allow us to specify very common additional semantics for attributes and operations in Standard MBeans.  For example, it would allow us to specify, for an attribute that is a metric, whether it is a gauge or a counter, what its units are, what its minimum and maximum values are, and so on.  Likewise, it would allow us to plug some holes that prevent the mapping between CIM objects and Standard MBeans from being fully reversible.

The suggested change is as follows:
- for every constructor in the classes MBean*Info (MBeanInfo, MBeanAttributeInfo, etc), add a parallel constructor with the same parameters plus an additional Descriptor parameter;
- likewise for OpenMBean*InfoSupport;
- add a parent interface of DescriptorAccess called DescriptorRead that contains the getDescriptor method but not the setDescriptor method and have the above classes implement it;
- add a parent class of DescriptorSupport called SimpleDescriptor that is a read-only Descriptor and that is in the javax.management package.

The last two changes are intended to preserve the present immutability of metadata for Standard MBeans, Open MBeans, and most user-coded Dynamic MBeans.  Model MBean metadata is not immutable since it is based on DescriptorSupport which is mutable.
###@###.### 2004-12-06 14:45:18 GMT

                                    

Comments
EVALUATION

This is a rather simple change but it adds a lot of power.  Ideally it would be accompanied by a second change that would translate annotations in Standard MBean interfaces into Descriptor entries.
###@###.### 2004-12-06 14:45:18 GMT
                                     
2004-12-06



Hardware and Software, Engineered to Work Together