United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-5072197 RFE: OpenMBeanNotificationInfo
JDK-5072197 : RFE: OpenMBeanNotificationInfo

Details
Type:
Enhancement
Submit Date:
2004-07-08
Status:
Closed
Updated Date:
2005-06-22
Project Name:
JDK
Resolved Date:
2005-06-22
Component:
core-svc
OS:
generic
Sub-Component:
javax.management
CPU:
generic
Priority:
P4
Resolution:
Won't Fix
Affected Versions:
6
Fixed Versions:

Related Reports
Relates:

Sub Tasks

Description
javax.management.openmbean defines various OpenMBean*Info classes that restrict the corresponding MBean*Info classes so that they can only refer to Open Types.  (More accurately, OpenMBeanAttributeInfo for example is an interface, implemented by OpenMBeanAttributeInfoSupport, which itself extends MBeanAttributeInfo.)  However, there is no OpenMBeanNotificationInfo.

The proposal would be to define an interface OpenMBeanNotificationInfo that includes all the methods from MBeanNotificationInfo, plus this one:
    public OpenType getUserDataType();
The corresponding concrete class OpenMBeanNotificationInfoSupport would extend MBeanNotificationInfo and have the following constructor:
    public OpenMBeanNotificationInfoSupport(String[] notifTypes,
                                            String description,
                                            OpenType userDataType);

The idea is that notifications emitted by an Open MBean should be constrained so that (1) they are always instances of javax.management.Notification and not a subclass; and (2) their userData (returned by Notification.getUserData()) is always an instance of the specified userDataType.  This ensures, consistent with the idea of Open MBeans, that a client can always understand these notifications without requiring any additional Java classes.

The various OpenMBean*InfoSupport classes are not final, but they probably should be, since if someone plugs a subclass of one of them into an Open MBean's MBeanInfo, that MBeanInfo will not be understandable by a client that does not know that class.  (Serialization tricks with writeReplace are not enough because Java serialization is not the only way clients may interact with the MBean Server.)  Compatibility rules forbid making the existing classes final, but the new class OpenMBeanNotificationInfoSupport probably should be.

                                    

Comments
PUBLIC COMMENTS

Add OpenMBeanNotificationInfo alongside existing OpenMBeanAttributeInfo etc.
                                     
2004-09-01
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
mustang


                                     
2004-09-01
EVALUATION

Straightforward extension, should be validated by the MXBean framework.
###@###.### 2004-07-08

Now that Descriptors are present in all types of MBean*Info, an alternative is simply to add an "openType" field to the Descriptor entry for a plain MBeanNotificationInfo.  By convention, such a field describes the type of the userData.  The main drawback of this approach is that the implementation does not verify that the associated value really is of a subclass of OpenType.
###@###.### 2005-06-07 14:51:53 GMT
                                     
2005-06-07



Hardware and Software, Engineered to Work Together