jmx-dev RFR: 8010285 Enforce the requirement of Management Interfaces being public
Daniel Fuchs
daniel.fuchs at oracle.com
Wed Jun 5 07:27:07 PDT 2013
On 6/5/13 3:55 PM, Jaroslav Bachorik wrote:
>> class A extends B { ...}
>> >class B implements AMBean {...}
> Yes, I see it now. However, when you check the JMX specification, page
> 50 onwards, the current implementation does not seem to be correct.
>
> "3. If MyClass is an instance of the DynamicMBean interface, then
> MyClassMBean is
> ignored. If MyClassMBean is not a public interface, it is not a JMX
> manageable
> resource. If the MBean is an instance of neither MyClassMBean nor
> DynamicMBean, the inheritance tree of MyClass is examined, looking for the
> nearest superclass that implements its own MBean interface.
> a. If there is an ancestor called SuperClass that is an instance of
> SuperClassMBean, the design patterns are used to derive the attributes and
> operations from SuperClassMBean. In this case, the MBean MyClass then
> has the same management interface as the MBean SuperClass. If
> SuperClassMBean is not a public interface, it is not a JMX manageable
> resource.
> b. When there is no superclass with its own MBean interface, MyClass is
> not a
> Standard MBean."
>
> According to the specification the correct MBean interface for
>
> class A extends B { ...}
> class B implements BMBean, AMBean
>
> would be BMBean
Hi Jaroslav,
Given that A is an instance of AMBean I think that according to the
specification the correct interface should be AMBean.
It's true that the JMX Specification does not explicitly speak of this
case - but neither does it forbid it.
My advice would therefore be to clarify the spec on this point,
if that's needed - rather than risking the introduction of
incompatibilities.
-- daniel
>
> and for
> class A extends B { ...}
> class B implements AMBean {...}
>
> is not defined; neither B or A are manageable resources.
>
> As I said, the jtreg and jck test does not seem to mind which
> implementation is used, they all pass happily. I would prefer bringing
> the implementation in sync with the specification.
>
> -JB-
>
More information about the serviceability-dev
mailing list