Java Reference
In-Depth Information
Table 12.3 Notification types that are common across all monitor MBeans, and the class members
that represent them in the MonitorNotification class.
Notification type
Public static final class member
Description
The attribute is not found in
the observed MBean.
jmx.moni-
tor.error.attribute
OBSERVED_ATTRIBUTE_ERROR
The attribute value type is not
correct.
jmx.moni-
tor.error.type
OBSERVED_ATTRIBUTE_TYPE_ERROR
The observed MBean cannot
be found.
jmx.moni-
tor.error.object
OBSERVED_OBJECT_ERROR
A runtime error has occurred
during monitoring.
jmx.moni-
tor.error.runtime
RUNTIME_ERROR
If you look at the API reference for the MonitorNotification class, you will see
more notification types than are listed in table 12.3. However, the remaining
types are common to a subset of the JMX monitor MBeans, so we'll list them in
the appropriate section.
Now that we have covered the foundations of the monitor MBeans available
in all agents, it is time to look at the individual MBeans.
12.1.2
Monitoring String values
The first monitoring MBean we will discuss is the String monitor, which is repre-
sented by the class javax.management.monitor.StringMonitor . As mentioned in
the previous section, all monitor MBeans extend the base class Monitor —the
StringMonitor class is no exception.
This monitor type is the simplest of the three we will cover. A String monitor
is used to observe an MBean attribute with a String value. The monitor com-
pares the observed attribute with a preconfigured String pattern. This pattern is
an actual String value; no wildcards can be used. The monitor can gather two
events from its observed attribute:
The observed String attribute matches the monitor's pattern.
The observed String does not match the monitor's pattern.
However, even though the String monitor takes an observation at every observa-
tion interval, it may not observe an event. These two events are significant only if
the observed attribute's value is different than the value from the previous obser-
vation interval. That means the monitor is interested only when the observed
attribute changes to a match or a mismatch (unless it is the first observation by
the monitor).
Search WWH ::




Custom Search