Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6204469
Votes 0
Synopsis Add Descriptor support to all types of MBean
Category jmx:classes
Reported Against
Release Fixed mustang(b37)
State 10-Fix Delivered, request for enhancement
Priority: 3-Medium
Related Bugs 6254721 , 4786777 , 6196560 , 5072268 , 6221321
Submit Date 06-DEC-2004
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.
  xxxxx@xxxxx   2004-12-06 14:45:18 GMT
Work Around
N/A
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.
  xxxxx@xxxxx   2004-12-06 14:45:18 GMT
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang