United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6254721 Define some standard Descriptor fields and set them for appropriate MBeans
JDK-6254721 : Define some standard Descriptor fields and set them for appropriate MBeans

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

Related Reports
Relates:
Relates:
Relates:
Relates:

Sub Tasks

Description
The JMX spec in Mustang will allow Descriptors in plain MBeanInfo (and MBeanAttributeInfo etc) as well as ModelMBeanInfo.  It should define some standard Descriptor fields beyond those already defined for Standard MBeans.  Here are some candidates:

* immutableInfo=true|false

When immutableInfo=true, the MBean promises that its metadata (MBeanInfo etc) will never change.  This means that a client can read it once and keep it in cache without ever having to check it.  By default an MBean is allowed to have MBeanInfo that changes over time, though this is usually discouraged.  Remote clients in particular can benefit from this.  For example, "cascading" (see 5072476) can avoid re-calling remote getMBeanInfo() whenever getMBeanInfo() is called on a proxy.  Since getMBeanInfo() is called for every security check when there is a security manager, this is a big win.

The MBeanInfo constructed for a Standard MBean can set immutableInfo=true except when the MBean is a NotificationBroadcaster (since its MBeanNotificationInfo[] could potentially change over time).  Ideally we would have a solution for the NotificationBroadcaster case too, perhaps through an annotation on the Standard MBean interface.

A Standard MBean implemented with the javax.management.StandardMBean class can set immutableInfo=true if it does not override the getCachedMBeanInfo() method, which can be determined through reflection.  A StandardMBean subclass that does override this method can still be immutable because it can insert the immutableInfo field itself.

* mbeanInterface=java.class.name

For an MBeanInfo, this would be a string that is the name of the Standard MBean Java interface that was used to derive it.  Dynamic MBeans could also set this field if there is an appropriate Java interface.  MXBeans would set it to the MXBean interface.

* originalType=java.type

MXBeans (see 6175517) would set this for the types of attributes and of operation parameters and return types to indicate the original Java type that was mapped to an Open Type.  In the case of operation return types, the field has to be put in the Descriptor of the MBeanOperationInfo, since there is no separate Descriptor for the return type.
###@###.### 2005-04-13 16:47:30 GMT

Another useful field would be "openType", with the corresponding value being a subclass of javax.management.openmbean.OpenType.  This would be set by default in the Descriptor for OpenMBeanAttributeInfo, OpenMBeanParameterInfo, and OpenMBeanOperationInfo (where it represents the return type of the operation).  The purpose of this field would be to allow MBeans that are not Open MBeans (specifically Model MBeans) to reuse the Open MBean concepts. 
###@###.### 2005-04-22 15:23:23 GMT
###@###.### 2005-05-09 09:09:10 GMT

                                    

Comments
EVALUATION

After discussion with the Expert Group, interfaceClassName is a better name than mbeanInterface.  Also added openType field following this discussion.
###@###.### 2005-04-22 15:43:13 GMT
                                     
2005-04-22



Hardware and Software, Engineered to Work Together