Dynamic MBean Inheritance Patterns

In this section, we will look at how the introspection process performed by the MBean server causes the inheritance patterns available to dynamic MBeans to differ from those available to standard MBeans.

Suppose that our application has the inheritance graph shown in Figure 3-2.

UML diagram showing a possible inheritance scenario for the sample application

Figure 3-2. UML diagram showing a possible inheritance scenario for the sample application

In this scenario, each class (with the exception of Supplier and Consumer) explicitly implements the DynamicMBean interface. Based on the information in the figure, what would you expect the management interface of, say, Controller to be? If you said that it would be the union of the management interface of Basic and Controller, you would be mistaken. You may recall from the previous chapter that using inheritance pattern #4 would allow a child class to augment its management interface with that of its parent class. However, no such inheritance patterns are available for dynamic MBeans.

What do you suppose the management interface of Supplier is? In fact, it may be a better question to ask whether Supplier is an MBean at all. The answer is yes, Supplier is indeed an MBean (in fact, a dynamic MBean), because it may inherit the dynamic MBean interface from its parent class. How is this possible? When Supplier is registered with the MBean server, the MBean server performs its introspection ...

Get Java Management Extensions now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.