JDK-6204469 : Add Descriptor support to all types of MBean
  • Type: Enhancement
  • Component: core-svc
  • Sub-Component: javax.management
  • Affected Version: 6
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2004-12-06
  • Updated: 2017-05-16
  • Resolved: 2005-05-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6 b37Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
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
06-12-2004