Search |
||
Why aren't MXBeans OpenMBeans?Posted by emcmanus on September 16, 2005 at 7:08 AM PDT
In a
comment on my last entry,
Therein lies a tale! MXBeans really are OpenMBeans. But as you note they don't return OpenMBeanInfo. However, in Mustang, all the same information that would have been in the OpenMBeanInfo is present via Descriptors. Instead of... MBeanInfo mbi = mbeanServer.getMBeanInfo(objectName); MBeanAttributeInfo mbai = mbi.getAttributes()[0]; OpenMBeanAttributeInfo ombai = (OpenMBeanAttributeInfo) mbai; OpenType ot = ombai.getOpenType(); ...you can use...
MBeanInfo mbi = mbeanServer.getMBeanInfo(objectName);
MBeanAttributeInfo mbai = mbi.getAttributes()[0];
Descriptor d = mbai.getDescriptor();
OpenType ot = (OpenType) d.getFieldValue("openType");
This fusion of OpenMBeanInfo functionality into plain MBeanInfo means that you can have OpenModelMBeans and other strange beasts. Nevertheless, we did originally plan for MXBeans to return OpenMBeanInfo. The reason they don't is subtle. In the original incarnation of MXBeans, in
java.lang.management, we wanted to use the type
It now is possible to have an array of primitive type as an OpenType, so we could now describe the ThreadMXBean with an OpenMBeanInfo. However, there are some interoperability concerns that we didn't foresee. Suppose you have a Tiger client, say
jconsole running on Tiger, talking to a Mustang server. Since
If jconsole saw an We could have envisaged various hacks to work around this
problem, but we decided it would be simpler to continue to use
For what it's worth, our implementation does use an
»
Related Topics >>
Open JDK Comments
Comments are listed in date ascending order (oldest first)
|
||
|
|