A gauge monitor observes an attribute that is continuously variable with time. A gauge monitor sends notifications as follows:
threshold high
notification
is sent. The notify high flag must be set to
true
.
threshold low
notification
is sent. The notify low flag must be set to
true
.
If the gauge difference mode is used, the value of the derived
gauge is calculated as the difference between the observed gauge
values for two successive observations.
The derived gauge value (V[t]) is calculated using the following method:
Byte
, Integer
, Short
,
Long
, Float
, Double
).
Modifier and Type | Class and Description |
---|---|
pack-priv static class |
Modifier and Type | Field and Description |
---|---|
private boolean | differenceMode
Flag indicating if the gauge difference mode is used. |
private static final int | |
private Number | highThreshold
Gauge high threshold. |
private Number | lowThreshold
Gauge low threshold. |
private static final MBeanNotificationInfo[] | |
private boolean | notifyHigh
Flag indicating if the gauge monitor notifies when exceeding the high threshold. |
private boolean | notifyLow
Flag indicating if the gauge monitor notifies when exceeding the low threshold. |
private static final int | |
private static final int | |
private static final String[] |
Access | Constructor and Description |
---|---|
public |
Modifier and Type | Method and Description |
---|---|
pack-priv synchronized MonitorNotification | buildAlarmNotification(ObjectName object, String attribute, Comparable<?> value)
Overrides javax.
|
pack-priv Monitor. | createObservedObject(ObjectName object)
Overrides javax. Factory method for ObservedObject creation. |
public synchronized Number | Returns: The derived gauge of the specified object.the name of the MBean. object)Overrides javax. Implements javax. Gets the derived gauge of the specified object, if this object is
contained in the set of observed MBeans, or |
public synchronized Number | Returns: The derived gauge.Implements javax.
Deprecated
As of JMX 1.2, replaced by
getDerivedGauge(ObjectName)
Returns the derived gauge of the first object in the set of observed MBeans. |
pack-priv synchronized Comparable | getDerivedGaugeFromComparable(ObjectName object, String attribute, Comparable<?> value)
Overrides javax.
|
public synchronized long | Returns: The derived gauge timestamp of the specified object.the name of the object whose derived gauge
timestamp is to be returned. object)Overrides javax. Implements javax. Gets the derived gauge timestamp of the specified object, if
this object is contained in the set of observed MBeans, or
|
public synchronized long | Returns: The derived gauge timestamp.Implements javax.
Deprecated
As of JMX 1.2, replaced by
getDerivedGaugeTimeStamp(ObjectName)
Gets the derived gauge timestamp of the first object in the set of observed MBeans. |
public synchronized boolean | Returns: true if the difference mode is used,
false otherwise.Implements javax. Gets the difference mode flag value common to all observed MBeans. |
public synchronized Number | Returns: The high threshold value.Implements javax. Gets the high threshold value common to all observed MBeans. |
public synchronized Number | Returns: The low threshold value.Implements javax. Gets the low threshold value common to all observed MBeans. |
public MBeanNotificationInfo[] | getNotificationInfo()
Overrides javax. Implements javax. Returns a |
public synchronized boolean | Returns: true if the gauge monitor notifies when
exceeding the high threshold, false otherwise.Implements javax. Gets the high notification's on/off switch value common to all observed MBeans. |
public synchronized boolean | Returns: true if the gauge monitor notifies when
exceeding the low threshold, false otherwise.Implements javax. Gets the low notification's on/off switch value common to all observed MBeans. |
pack-priv synchronized boolean | isComparableTypeValid(ObjectName object, String attribute, Comparable<?> value)
Overrides javax. This method globally sets the derived gauge type for the given "object" and "attribute" after checking that the type of the supplied observed attribute value is one of the value types supported by this monitor. |
private boolean | Returns: true if the first specified Number is
greater than or equal to the last, false
otherwise.The first Number to compare with the second. greater, Number The second Number to compare with the first. less, Monitor.The number type. typeTests if the first specified Number is greater than or equal to the last. |
private boolean | Returns: true if the first specified Number is
strictly greater than the last, false otherwise.The first Number to compare with the second. greater, Number The second Number to compare with the first. less, String The number class name. className)Tests if the first specified Number is strictly greater than the last. |
pack-priv synchronized boolean | Returns: true if type is the same,
false otherwise.The observed object. object, String The observed attribute. attribute, Comparable<?> The sample value. value)Overrides javax. Tests if the threshold high and threshold low are both of the same type as the gauge. |
pack-priv synchronized void | onErrorNotification(MonitorNotification notification)
Overrides javax.
|
private synchronized void | setDerivedGaugeWithDifference(Number
The value of the observed attribute. scanGauge, GaugeMonitor.The observed object. oSets the derived gauge when the differenceMode flag is set to
|
public synchronized void | setDifferenceMode(boolean
The difference mode flag value. value)Implements javax. Sets the difference mode flag value common to all observed MBeans. |
public synchronized void | setNotifyHigh(boolean
The high notification's on/off switch value. value)Implements javax. Sets the high notification's on/off switch value common to all observed MBeans. |
public synchronized void | setNotifyLow(boolean
The low notification's on/off switch value. value)Implements javax. Sets the low notification's on/off switch value common to all observed MBeans. |
public synchronized void | setThresholds(Number
The high threshold value. highValue, Number The low threshold value. lowValue)Implements javax. Sets the high and the low threshold values common to all observed MBeans. |
public synchronized void | start()
Implements abstract javax. Implements javax. Starts the gauge monitor. |
public synchronized void | stop()
Implements abstract javax. Implements javax. Stops the gauge monitor. |
private synchronized boolean | Returns: true if the derived gauge value is valid,
false otherwise. The derived gauge value is
invalid when the differenceMode flag is set to
true and it is the first notification (so we
haven't 2 consecutive values to update the derived gauge).The value of the observed attribute. scanGauge, GaugeMonitor.The observed object. oUpdates the derived gauge attribute of the observed object. |
private synchronized MonitorNotification | updateNotifications(GaugeMonitor.
The observed object. oUpdates the notification attribute of the observed object
and notifies the listeners only once if the notify flag
is set to |
differenceMode | back to summary |
---|---|
private boolean differenceMode Flag indicating if the gauge difference mode is used. If the
gauge difference mode is used, the derived gauge is the
difference between two consecutive observed values. Otherwise,
the derived gauge is directly the value of the observed
attribute.
|
FALLING | back to summary |
---|---|
private static final int FALLING |
highThreshold | back to summary |
---|---|
private Number highThreshold Gauge high threshold.
|
lowThreshold | back to summary |
---|---|
private Number lowThreshold Gauge low threshold.
|
notifsInfo | back to summary |
---|---|
private static final MBeanNotificationInfo[] notifsInfo |
notifyHigh | back to summary |
---|---|
private boolean notifyHigh Flag indicating if the gauge monitor notifies when exceeding
the high threshold.
|
notifyLow | back to summary |
---|---|
private boolean notifyLow Flag indicating if the gauge monitor notifies when exceeding
the low threshold.
|
RISING | back to summary |
---|---|
private static final int RISING |
RISING_OR_FALLING | back to summary |
---|---|
private static final int RISING_OR_FALLING |
types | back to summary |
---|---|
private static final String[] types |
GaugeMonitor | back to summary |
---|---|
public GaugeMonitor() Default constructor. |
buildAlarmNotification | back to summary |
---|---|
pack-priv synchronized MonitorNotification buildAlarmNotification(ObjectName object, String attribute, Comparable<?> value) Overrides javax.
|
createObservedObject | back to summary |
---|---|
pack-priv Monitor. Overrides javax. Factory method for ObservedObject creation.
|
getDerivedGauge | back to summary |
---|---|
public synchronized Number getDerivedGauge(ObjectName object) Overrides javax. Implements javax. Gets the derived gauge of the specified object, if this object is
contained in the set of observed MBeans, or
|
getDerivedGauge | back to summary |
---|---|
public synchronized Number getDerivedGauge() Implements javax. Deprecated As of JMX 1.2, replaced by
Returns the derived gauge of the first object in the set of observed MBeans.
|
getDerivedGaugeFromComparable | back to summary |
---|---|
pack-priv synchronized Comparable Overrides javax.
|
getDerivedGaugeTimeStamp | back to summary |
---|---|
public synchronized long getDerivedGaugeTimeStamp(ObjectName object) Overrides javax. Implements javax. Gets the derived gauge timestamp of the specified object, if
this object is contained in the set of observed MBeans, or
|
getDerivedGaugeTimeStamp | back to summary |
---|---|
public synchronized long getDerivedGaugeTimeStamp() Implements javax. Deprecated As of JMX 1.2, replaced by
Gets the derived gauge timestamp of the first object in the set of observed MBeans.
|
getDifferenceMode | back to summary |
---|---|
public synchronized boolean getDifferenceMode() Implements javax. Gets the difference mode flag value common to all observed MBeans.
|
getHighThreshold | back to summary |
---|---|
public synchronized Number getHighThreshold() Implements javax. Gets the high threshold value common to all observed MBeans.
|
getLowThreshold | back to summary |
---|---|
public synchronized Number getLowThreshold() Implements javax. Gets the low threshold value common to all observed MBeans.
|
getNotificationInfo | back to summary |
---|---|
public MBeanNotificationInfo[] getNotificationInfo() Overrides javax. Implements javax. Returns a
|
getNotifyHigh | back to summary |
---|---|
public synchronized boolean getNotifyHigh() Implements javax. Gets the high notification's on/off switch value common to all observed MBeans.
|
getNotifyLow | back to summary |
---|---|
public synchronized boolean getNotifyLow() Implements javax. Gets the low notification's on/off switch value common to all observed MBeans.
|
isComparableTypeValid | back to summary |
---|---|
pack-priv synchronized boolean isComparableTypeValid(ObjectName object, String attribute, Comparable<?> value) Overrides javax. This method globally sets the derived gauge type for the given "object" and "attribute" after checking that the type of the supplied observed attribute value is one of the value types supported by this monitor.
|
isFirstGreaterThanLast | back to summary |
---|---|
private boolean isFirstGreaterThanLast(Number greater, Number less, Monitor. Tests if the first specified Number is greater than or equal to the last. Both integer and floating-point types are allowed.
|
isFirstStrictlyGreaterThanLast | back to summary |
---|---|
private boolean isFirstStrictlyGreaterThanLast(Number greater, Number less, String className) Tests if the first specified Number is strictly greater than the last. Both integer and floating-point types are allowed. |
isThresholdTypeValid | back to summary |
---|---|
pack-priv synchronized boolean isThresholdTypeValid(ObjectName object, String attribute, Comparable<?> value) Overrides javax. Tests if the threshold high and threshold low are both of the same type as the gauge. Both integer and floating-point types are allowed. Note If the optional lowThreshold or highThreshold have not been initialized, their default value is an Integer object with a value equal to zero.
|
onErrorNotification | back to summary |
---|---|
pack-priv synchronized void onErrorNotification(MonitorNotification notification) Overrides javax.
|
setDerivedGaugeWithDifference | back to summary |
---|---|
private synchronized void setDerivedGaugeWithDifference(Number scanGauge, GaugeMonitor. Sets the derived gauge when the differenceMode flag is set to
|
setDifferenceMode | back to summary |
---|---|
public synchronized void setDifferenceMode(boolean value) Implements javax. Sets the difference mode flag value common to all observed MBeans.
|
setNotifyHigh | back to summary |
---|---|
public synchronized void setNotifyHigh(boolean value) Implements javax. Sets the high notification's on/off switch value common to all observed MBeans.
|
setNotifyLow | back to summary |
---|---|
public synchronized void setNotifyLow(boolean value) Implements javax. Sets the low notification's on/off switch value common to all observed MBeans.
|
setThresholds | back to summary |
---|---|
public synchronized void setThresholds(Number highValue, Number lowValue) throws IllegalArgumentException Implements javax. Sets the high and the low threshold values common to all observed MBeans.
|
start | back to summary |
---|---|
public synchronized void start() Implements abstract javax. Implements javax. Starts the gauge monitor. |
stop | back to summary |
---|---|
public synchronized void stop() Implements abstract javax. Implements javax. Stops the gauge monitor. |
updateDerivedGauge | back to summary |
---|---|
private synchronized boolean updateDerivedGauge(Object scanGauge, GaugeMonitor. Updates the derived gauge attribute of the observed object.
|
updateNotifications | back to summary |
---|---|
private synchronized MonitorNotification updateNotifications(GaugeMonitor. Updates the notification attribute of the observed object
and notifies the listeners only once if the notify flag
is set to
|
Modifier and Type | Field and Description |
---|---|
private boolean | |
private Number | |
private int | |
private Monitor. |
Access | Constructor and Description |
---|---|
public |
Modifier and Type | Method and Description |
---|---|
public final synchronized boolean | |
public final synchronized Number | |
public final synchronized int | |
public final synchronized Monitor. | |
public final synchronized void | |
public final synchronized void | |
public final synchronized void | |
public final synchronized void |
derivedGaugeValid | back to summary |
---|---|
private boolean derivedGaugeValid |
previousScanGauge | back to summary |
---|---|
private Number previousScanGauge |
status | back to summary |
---|---|
private int status |
type | back to summary |
---|---|
private Monitor. |
GaugeMonitorObservedObject | back to summary |
---|---|
public GaugeMonitorObservedObject(ObjectName observedObject) |
getDerivedGaugeValid | back to summary |
---|---|
public final synchronized boolean getDerivedGaugeValid() |
getPreviousScanGauge | back to summary |
---|---|
public final synchronized Number getPreviousScanGauge() |
getStatus | back to summary |
---|---|
public final synchronized int getStatus() |
getType | back to summary |
---|---|
public final synchronized Monitor. |
setDerivedGaugeValid | back to summary |
---|---|
public final synchronized void setDerivedGaugeValid(boolean derivedGaugeValid) |
setPreviousScanGauge | back to summary |
---|---|
public final synchronized void setPreviousScanGauge(Number previousScanGauge) |
setStatus | back to summary |
---|---|
public final synchronized void setStatus(int status) |
setType | back to summary |
---|---|
public final synchronized void setType(Monitor. |