Java Reference
In-Depth Information
Storing the attribute value
Each Model MBean attribute can be cached locally in the MBean. So, managed
resources' attributes can be stored locally for quick retrieval. This behavior is
configured on a per-MBean-attribute basis using the following descriptor
attributes: value , currencyTimeLimit , and lastUpdatedTimeStamp .
The value attribute is the most current updated value of the MBean attribute.
However, if you are depending on this being an accurate reflection of the MBean
attribute value (because other processes besides the MBean could be changing
it), you need to know when it was last acquired. The currencyTimeLimit descrip-
tor attribute is used to configure how often the JMX agent will access this
attribute and update the descriptor value. It can have one of three integer val-
ues: less than zero (never update), 0 (always update), and greater than zero
(update every x seconds). In addition, the lastUpdatedTimeStamp descriptor
attribute provides the timestamp of when the MBean was last used to update the
attribute value.
Creating attributes not in the managed resource
Another interesting feature of Model MBeans is their ability to expose attributes
of the MBean and attributes of its managed resource. To the management user,
both attributes are from the same source (the resource being managed by the
MBean); but in reality, you can add an attribute to a Model MBean that is not
present in its managed resource. Essentially, such attributes have no getter or
setter methods and are static values presented in the management interface.
7.4.4
The ModelMBeanOperationInfo class
Like the ModelMBeanAttributeInfo class, the ModelMBeanOperationInfo class pro-
vides some unique behavioral configuration for Model MBeans. With the Model
MBean, you can expose operations for your management interface that belong
to objects other than the one contained as the Model MBean's managed
resource. In addition, you can configure the MBean to cache the return value of
the operation. Table 7.4 lists the predefined descriptor attributes for operations.
Table 7.4
Operation-level descriptor attributes
Descriptor attribute
Possible values
Description
User-defined
Name of the MBean
name
mbean , attribute , opera-
tion , notification
Type of descriptor
descriptorType
Search WWH ::




Custom Search