Java Reference
In-Depth Information
Table 12.4 The important methods of the GaugeMonitor class and their purpose. For each setter
method, there is a corresponding getter method.
Method
Purpose
Sets the high and low threshold values for the monitor using
the java.lang.Number class
setThresholds( Number high,
Number low)
If true, tells the MBean to compute its derived gauge using the
subtraction scenario already described
setDifferenceMode( boolean )
Tells the monitor to send notifications when a high-threshold
event occurs
setNotifyHigh( boolean )
Tells the monitor to send notifications when a low-threshold
event occurs
setNotifyLow( boolean )
Only two constraints exist on a GaugeMonitor MBean. First, the high and low
threshold values must be of the same type as the observed attribute's value. Sec-
ond, the high threshold value must be greater than or equal to the low thresh-
old value. (Recall that Gauge monitors operate on Float and Double attribute
value types.)
GaugeMonitor notifications
In our discussion of the MonitorNotification class, we left out one common noti-
fication type defined by that class. Both the GaugeMonitor class and the following
CounterMonitor class can send notifications with the type jmx.monitor.error.
threshold . However, this type has a different meaning for the two monitors. For
the Gauge monitor, it means that either the low or high threshold value is not
the same type as the observed attribute value. The Counter monitor is explained
in the next section.
In addition to the common notification type, the Gauge monitor can send out
two more notification types:
jmx.monitor.gauge.high —Sent when the derived gauge has exceeded the
high threshold value
jmx.monitor.gauge.low —Sent when the derived gauge has exceeded the
low threshold value
The following section discusses the final monitor MBean: the previously men-
tioned CounterMonitor .
Search WWH ::




Custom Search