Java Reference
In-Depth Information
management interface of the new Model MBean (this object describes
the Model MBean managed resource).
The application invokes an operation on the new Model MBean that sets
the ModelMBeanInfo object.
5
At this point, the new Model MBean can be used to manage the application to
the extent that its management interface allows. Using the Model MBean not
only saves you development time, it also gives you the many features that come
with the MBean. The next section highlights some of the most important Model
MBean features and how they can be useful in a management environment.
7.2 F eatures of the Model MBean
The fact that Model MBeans can be created in any JMX -compliant agent is a
great advantage for managing applications. It means that without writing any
MBean code, you can instrument resources using a management tool interfacing
with a JMX agent. Essentially, you can model a resource by describing its man-
agement interface in a Model MBean at runtime, exposing as much or as little as
needed. That one advantage is enough to support the use of this type of MBean,
but the Model MBean also has much more to offer.
The Model MBean has many features available for use; this section will high-
light a few key ones. As you read this chapter, we'll discuss all the features of the
Model MBean.
7.2.1
MBean persistence
One of the most valuable features of the Model MBean is its ability to persist
itself. For a Model MBean, this means that it will not need to reset its managed
resource and ModelMBeanInfoSupport objects. By using its persistence mecha-
nism, a Model MBean can survive the cycling of the JMX agent that contains it.
Each time a Model MBean is constructed, it checks to see if it can load its state
from a specified location. When configuring a Model MBean, you can specify
how often it should save its state.
The persistence mechanism of the Model MBean implementation provided
in the Sun Reference Implementation ( RI ) uses Java Object Serialization to write
the current state of the MBean's ModelMBeanInfo object out to a flat file location
specified when the MBean was created. Other JMX implementations could pro-
vide different persistence mechanisms for their Model MBean implementations,
such as JDBC .
Search WWH ::




Custom Search