How Do Model MBeans Work?
Like all other MBean types, model MBeans must be created and registered with the MBean server, and, as with dynamic MBeans, the management interface of your resource is exposed through metadata classes. The similarities end there.
Every compliant JMX implementation must ship a class called
RequiredModelMBean. This class is instantiated and
registered with the MBean server, and it implements several
interfaces (including DynamicMBean) that make the
life of the instrumentation developer easier. But what is it that
makes a model MBean tick? What makes a model MBean work and live up
to its reputation (which we discussed in the previous section)? The
rest of this section is devoted to answering those questions.
Model MBean Descriptors
The key difference between
instrumenting
a resource as a model MBean versus as a dynamic MBean
is the Descriptor interface. A class implementing
this interface describes certain properties of the MBean to the agent
level of the JMX architecture, other MBeans, and management
applications. Each descriptor contains one or
more fields, which have corresponding
Object values. Think of a field as a property of the MBean that gives some other party in the system (usually a management application) a little “nugget” of information about the MBean or one of its features (such as an attribute or operation). Of course, in order to exploit the full power of a descriptor, the management application must know about model MBeans. If the management ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access