Java Reference
In-Depth Information
7.2.2
Notification logging
Another valuable feature of the Model MBean is its ability to log each notifica-
tion it emits. The Model MBean allows you to specify a log file location where it
should write emitted notifications.
Using the notification logging mechanism lets you maintain an accurate record
of all notifications sent by a particular MBean. This record is useful for keeping an
audit trail of important management information from a particular resource.
7.2.3
Attribute value caching
A valuable performance feature built into the Model MBean is the ability to
cache attribute values. The ModelMBeanInfo object associated with a Model
MBean determines the attribute caching policy. For example, a Model MBean
can be configured to locally store the value of an attribute after it is first
acquired. Subsequent requests for this attribute can be satisfied with the local
copy. How often the cache is updated is determined by the caching policy associ-
ated with the specific attribute, and configured by the user.
This ability can greatly increase a program's performance. If the operation
that acquired the value of an attribute is costly, you can configure the caching
policy to decrease the number of times the operation must be invoked to get the
attribute. For instance, if the Model MBean manages a remote resource that has
fairly static attributes, it could store their values locally in order to avoid repeat-
edly making a remote operation call to retrieve them.
7.2.4
Operation delegation
The Model MBean can have operations in its management interface that are
invoked on objects other than its managed resource. When exposing a particular
method for management, you can optionally include an Object reference in
which to invoke the operation.
The delegation ability lets you expose operations that may interact with more
than just your single manageable resource. For instance, you can delegate an
exposed operation to an EJB , Java remote object, or any other Object reference.
Currently, the Sun RI only supports Object references—other implementations
(or your own subclass) could support the other types of delegation.
7.2.5
Generic notifications
The Model MBean also provides methods to send out generic, purely informa-
tional notifications. In the Model MBean implementation, there is a method that
Search WWH ::




Custom Search