XMOJO 5 API Docs

javax.management.monitor
Class GaugeMonitor

java.lang.Object
  |
  +--javax.management.NotificationBroadcasterSupport
        |
        +--javax.management.monitor.Monitor
              |
              +--javax.management.monitor.GaugeMonitor
All Implemented Interfaces:
GaugeMonitorMBean, MBeanRegistration, MonitorMBean, NotificationBroadcaster, java.io.Serializable

public class GaugeMonitor
extends Monitor
implements GaugeMonitorMBean

Defines a monitor MBean designed to observe the values of a gauge attribute.

A gauge monitor observes an attribute that is continuously variable with time. A gauge monitor sends notifications as follows:

This provides a hysteresis mechanism to avoid repeated triggering of notifications when the attribute value makes small oscillations around the high or low threshold value.

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:

This implementation of the gauge monitor requires the observed attribute to be of the type integer or floating-point (Byte, Integer, Short, Long, Float, Double).

See Also:
Serialized Form

Fields inherited from class javax.management.monitor.Monitor
alreadyNotified, dgbTag, OBSERVED_ATTRIBUTE_ERROR_NOTIFIED, OBSERVED_ATTRIBUTE_TYPE_ERROR_NOTIFIED, OBSERVED_OBJECT_ERROR_NOTIFIED, RESET_FLAGS_ALREADY_NOTIFIED, RUNTIME_ERROR_NOTIFIED, server
 
Constructor Summary
GaugeMonitor()
          Default Constructor.
 
Method Summary
 java.lang.Number getDerivedGauge()
          This method gets the value of the derived gauge.
 long getDerivedGaugeTimeStamp()
          This method gets the value of the derived gauge time stamp.The derived gauge time stamp* is the value(in the nearest miliseconds) when the notification was triggered.
 boolean getDifferenceMode()
          This method gets the value of the difference mode.
 java.lang.Number getHighThreshold()
          This method gets the value of the high threshold.
 java.lang.Number getLowThreshold()
          This method gets the value of the low threshold.
 MBeanNotificationInfo[] getNotificationInfo()
          This method returns a NotificationInfo object containing the name of the Java class of the notification and the notification types sent by the counter monitor.
 boolean getNotifyHigh()
          This method gets the high notification's on/off switch value.
 boolean getNotifyLow()
          This method gets the low notification's on/off switch value.
 ObjectName preRegister(MBeanServer server, ObjectName name)
          Overriding the preRegister() of MBeanRegistration interface to store the ObjectName locally.
 void setDifferenceMode(boolean value)
          This method sets the state of the difference mode.
 void setNotifyHigh(boolean value)
          This method sets the high notification's on/off switch value.
 void setNotifyLow(boolean value)
          This method sets the low notification's on/off switch value.
 void setThresholds(java.lang.Number highValue, java.lang.Number lowValue)
          This method sets the high threshold and low threshold values.
 void start()
          Starts the Gauge monitor.
 void stop()
          Stops the Gauge Monitor.
 
Methods inherited from class javax.management.monitor.Monitor
getGranularityPeriod, getObservedAttribute, getObservedObject, isActive, postDeregister, postRegister, preDeregister, setGranularityPeriod, setObservedAttribute, setObservedObject
 
Methods inherited from class javax.management.NotificationBroadcasterSupport
addNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.management.monitor.MonitorMBean
getGranularityPeriod, getObservedAttribute, getObservedObject, isActive, setGranularityPeriod, setObservedAttribute, setObservedObject
 

Constructor Detail

GaugeMonitor

public GaugeMonitor()
Default Constructor.
Method Detail

start

public void start()
Starts the Gauge monitor.
Specified by:
start in interface MonitorMBean
Overrides:
start in class Monitor

stop

public void stop()
Stops the Gauge Monitor.
Specified by:
stop in interface MonitorMBean
Overrides:
stop in class Monitor

getNotificationInfo

public MBeanNotificationInfo[] getNotificationInfo()
This method returns a NotificationInfo object containing the name of the Java class of the notification and the notification types sent by the counter monitor.
Overrides:
getNotificationInfo in class Monitor
Returns:
An Array of MBeanNotificationInfo objects.

getDerivedGauge

public java.lang.Number getDerivedGauge()
This method gets the value of the derived gauge. The derived gauge is either the exact value of the observed attribute, or the difference between the two consecutive observed values of the attribute.
Specified by:
getDerivedGauge in interface GaugeMonitorMBean
Returns:
An instance of java.lang.Number giving the value of the derived gauge.

getDerivedGaugeTimeStamp

public long getDerivedGaugeTimeStamp()
This method gets the value of the derived gauge time stamp.The derived gauge time stamp* is the value(in the nearest miliseconds) when the notification was triggered.
Specified by:
getDerivedGaugeTimeStamp in interface GaugeMonitorMBean
Returns:
long value representing the time the notification was triggered.

getDifferenceMode

public boolean getDifferenceMode()
This method gets the value of the difference mode. If the difference mode is true, the difference mode option is set to calculate the value of the derived gauge.
Specified by:
getDifferenceMode in interface GaugeMonitorMBean
Returns:
boolean value indicating whether the difference mode option is set.

setDifferenceMode

public void setDifferenceMode(boolean value)
This method sets the state of the difference mode.
Specified by:
setDifferenceMode in interface GaugeMonitorMBean
Parameters:
value - boolean value representing the state of the difference mode.

getHighThreshold

public java.lang.Number getHighThreshold()
This method gets the value of the high threshold.
Specified by:
getHighThreshold in interface GaugeMonitorMBean
Returns:
An instance of java.lang.Number giving the value of the high threshold.

getLowThreshold

public java.lang.Number getLowThreshold()
This method gets the value of the low threshold.
Specified by:
getLowThreshold in interface GaugeMonitorMBean
Returns:
An instance of java.lang.Number giving the value of the low threshold.

setThresholds

public void setThresholds(java.lang.Number highValue,
                          java.lang.Number lowValue)
                   throws java.lang.IllegalArgumentException
This method sets the high threshold and low threshold values.
Specified by:
setThresholds in interface GaugeMonitorMBean
Parameters:
highValue - - The high threshold value.
lowValue - - The low threshold value.
Throws:
java.lang.IllegalArgumentException - - The specified high/low threshold is null or the low threshold is greater than the high threshold or the high threshold and the low threshold are not of the same type.

getNotifyHigh

public boolean getNotifyHigh()
This method gets the high notification's on/off switch value.
Specified by:
getNotifyHigh in interface GaugeMonitorMBean
Returns:
true if the gauge monitor notifies when exceeding the high threshold, false otherwise.

setNotifyHigh

public void setNotifyHigh(boolean value)
This method sets the high notification's on/off switch value.
Specified by:
setNotifyHigh in interface GaugeMonitorMBean
Parameters:
value - - The high notification's on/off switch value.

getNotifyLow

public boolean getNotifyLow()
This method gets the low notification's on/off switch value.
Specified by:
getNotifyLow in interface GaugeMonitorMBean
Returns:
true if the gauge monitor notifies when exceeding the low threshold, false otherwise.

setNotifyLow

public void setNotifyLow(boolean value)
This method sets the low notification's on/off switch value.
Specified by:
setNotifyLow in interface GaugeMonitorMBean
Parameters:
value - - The low notification's on/off switch value.

preRegister

public ObjectName preRegister(MBeanServer server,
                              ObjectName name)
                       throws java.lang.Exception
Overriding the preRegister() of MBeanRegistration interface to store the ObjectName locally.
Overrides:
preRegister in class Monitor
Following copied from class: javax.management.monitor.Monitor
Parameters:
server - - The MBean server in which the monitor MBean will be registered.
name - - The object name of the monitor MBean.
Returns:
This method allows the monitor MBean to perform any operations it needs before being registered in the MBean server.
Throws:
- - java.lang.Exception.

XMOJO 5 API Docs

Copyright ©2003 XMOJO.org. All Rights Reserved.