- java.lang.Object
- 
- javax.management.NotificationBroadcasterSupport
- 
- javax.management.monitor.Monitor
- 
- javax.management.monitor.GaugeMonitor
 
 
 
- 
- All Implemented Interfaces:
- MBeanRegistration,- GaugeMonitorMBean,- MonitorMBean,- NotificationBroadcaster,- NotificationEmitter
 
 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: -  if the attribute value is increasing and becomes equal to or
 greater than the high threshold value, a threshold high notificationis sent. The notify high flag must be set totrue.
 Subsequent crossings of the high threshold value do not cause further notifications unless the attribute value becomes equal to or less than the low threshold value.
-  if the attribute value is decreasing and becomes equal to or
 less than the low threshold value, a threshold low notificationis sent. The notify low flag must be set totrue.
 Subsequent crossings of the low threshold value do not cause further notifications unless the attribute value becomes equal to or greater than the high 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:- V[t] = gauge[t] - gauge[t-GP]
 Byte,Integer,Short,Long,Float,Double).- Since:
- 1.5
 
- 
- 
Field Summary- 
Fields declared in class javax.management.monitor.MonitoralreadyNotified, alreadyNotifieds, capacityIncrement, dbgTag, elementCount, OBSERVED_ATTRIBUTE_ERROR_NOTIFIED, OBSERVED_ATTRIBUTE_TYPE_ERROR_NOTIFIED, OBSERVED_OBJECT_ERROR_NOTIFIED, RESET_FLAGS_ALREADY_NOTIFIED, RUNTIME_ERROR_NOTIFIED, server
 
- 
 - 
Constructor SummaryConstructors Constructor Description GaugeMonitor()Default constructor.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description NumbergetDerivedGauge()Deprecated.As of JMX 1.2, replaced bygetDerivedGauge(ObjectName)NumbergetDerivedGauge(ObjectName object)Gets the derived gauge of the specified object, if this object is contained in the set of observed MBeans, ornullotherwise.longgetDerivedGaugeTimeStamp()Deprecated.As of JMX 1.2, replaced bygetDerivedGaugeTimeStamp(ObjectName)longgetDerivedGaugeTimeStamp(ObjectName object)Gets the derived gauge timestamp of the specified object, if this object is contained in the set of observed MBeans, or0otherwise.booleangetDifferenceMode()Gets the difference mode flag value common to all observed MBeans.NumbergetHighThreshold()Gets the high threshold value common to all observed MBeans.NumbergetLowThreshold()Gets the low threshold value common to all observed MBeans.MBeanNotificationInfo[]getNotificationInfo()Returns aNotificationInfoobject containing the name of the Java class of the notification and the notification types sent by the gauge monitor.booleangetNotifyHigh()Gets the high notification's on/off switch value common to all observed MBeans.booleangetNotifyLow()Gets the low notification's on/off switch value common to all observed MBeans.voidsetDifferenceMode(boolean value)Sets the difference mode flag value common to all observed MBeans.voidsetNotifyHigh(boolean value)Sets the high notification's on/off switch value common to all observed MBeans.voidsetNotifyLow(boolean value)Sets the low notification's on/off switch value common to all observed MBeans.voidsetThresholds(Number highValue, Number lowValue)Sets the high and the low threshold values common to all observed MBeans.voidstart()Starts the gauge monitor.voidstop()Stops the gauge monitor.- 
Methods declared in class javax.management.monitor.MonitoraddObservedObject, containsObservedObject, getGranularityPeriod, getObservedAttribute, getObservedObject, getObservedObjects, isActive, postDeregister, postRegister, preDeregister, preRegister, removeObservedObject, setGranularityPeriod, setObservedAttribute, setObservedObject
 - 
Methods declared in class javax.management.NotificationBroadcasterSupportaddNotificationListener, handleNotification, sendNotification
 - 
Methods declared in class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods declared in interface javax.management.monitor.MonitorMBeanaddObservedObject, containsObservedObject, getGranularityPeriod, getObservedAttribute, getObservedObject, getObservedObjects, isActive, removeObservedObject, setGranularityPeriod, setObservedAttribute, setObservedObject
 - 
Methods declared in interface javax.management.NotificationBroadcasterremoveNotificationListener
 - 
Methods declared in interface javax.management.NotificationEmitterremoveNotificationListener
 
- 
 
- 
- 
- 
Method Detail- 
startpublic void start() Starts the gauge monitor.- Specified by:
- startin interface- MonitorMBean
- Specified by:
- startin class- Monitor
 
 - 
stoppublic void stop() Stops the gauge monitor.- Specified by:
- stopin interface- MonitorMBean
- Specified by:
- stopin class- Monitor
 
 - 
getDerivedGaugepublic Number getDerivedGauge(ObjectName object) Gets the derived gauge of the specified object, if this object is contained in the set of observed MBeans, ornullotherwise.- Specified by:
- getDerivedGaugein interface- GaugeMonitorMBean
- Parameters:
- object- the name of the MBean.
- Returns:
- The derived gauge of the specified object.
 
 - 
getDerivedGaugeTimeStamppublic long getDerivedGaugeTimeStamp(ObjectName object) Gets the derived gauge timestamp of the specified object, if this object is contained in the set of observed MBeans, or0otherwise.- Specified by:
- getDerivedGaugeTimeStampin interface- GaugeMonitorMBean
- Parameters:
- object- the name of the object whose derived gauge timestamp is to be returned.
- Returns:
- The derived gauge timestamp of the specified object.
 
 - 
getDerivedGauge@Deprecated public Number getDerivedGauge() Deprecated.As of JMX 1.2, replaced bygetDerivedGauge(ObjectName)Returns the derived gauge of the first object in the set of observed MBeans.- Specified by:
- getDerivedGaugein interface- GaugeMonitorMBean
- Returns:
- The derived gauge.
 
 - 
getDerivedGaugeTimeStamp@Deprecated public long getDerivedGaugeTimeStamp() Deprecated.As of JMX 1.2, replaced bygetDerivedGaugeTimeStamp(ObjectName)Gets the derived gauge timestamp of the first object in the set of observed MBeans.- Specified by:
- getDerivedGaugeTimeStampin interface- GaugeMonitorMBean
- Returns:
- The derived gauge timestamp.
 
 - 
getHighThresholdpublic Number getHighThreshold() Gets the high threshold value common to all observed MBeans.- Specified by:
- getHighThresholdin interface- GaugeMonitorMBean
- Returns:
- The high threshold value.
- See Also:
- setThresholds(java.lang.Number, java.lang.Number)
 
 - 
getLowThresholdpublic Number getLowThreshold() Gets the low threshold value common to all observed MBeans.- Specified by:
- getLowThresholdin interface- GaugeMonitorMBean
- Returns:
- The low threshold value.
- See Also:
- setThresholds(java.lang.Number, java.lang.Number)
 
 - 
setThresholdspublic void setThresholds(Number highValue, Number lowValue) throws IllegalArgumentException Sets the high and the low threshold values common to all observed MBeans.- Specified by:
- setThresholdsin interface- GaugeMonitorMBean
- Parameters:
- highValue- The high threshold value.
- lowValue- The low threshold value.
- Throws:
- 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.
- See Also:
- getHighThreshold(),- getLowThreshold()
 
 - 
getNotifyHighpublic boolean getNotifyHigh() Gets the high notification's on/off switch value common to all observed MBeans.- Specified by:
- getNotifyHighin interface- GaugeMonitorMBean
- Returns:
- trueif the gauge monitor notifies when exceeding the high threshold,- falseotherwise.
- See Also:
- setNotifyHigh(boolean)
 
 - 
setNotifyHighpublic void setNotifyHigh(boolean value) Sets the high notification's on/off switch value common to all observed MBeans.- Specified by:
- setNotifyHighin interface- GaugeMonitorMBean
- Parameters:
- value- The high notification's on/off switch value.
- See Also:
- getNotifyHigh()
 
 - 
getNotifyLowpublic boolean getNotifyLow() Gets the low notification's on/off switch value common to all observed MBeans.- Specified by:
- getNotifyLowin interface- GaugeMonitorMBean
- Returns:
- trueif the gauge monitor notifies when exceeding the low threshold,- falseotherwise.
- See Also:
- setNotifyLow(boolean)
 
 - 
setNotifyLowpublic void setNotifyLow(boolean value) Sets the low notification's on/off switch value common to all observed MBeans.- Specified by:
- setNotifyLowin interface- GaugeMonitorMBean
- Parameters:
- value- The low notification's on/off switch value.
- See Also:
- getNotifyLow()
 
 - 
getDifferenceModepublic boolean getDifferenceMode() Gets the difference mode flag value common to all observed MBeans.- Specified by:
- getDifferenceModein interface- GaugeMonitorMBean
- Returns:
- trueif the difference mode is used,- falseotherwise.
- See Also:
- setDifferenceMode(boolean)
 
 - 
setDifferenceModepublic void setDifferenceMode(boolean value) Sets the difference mode flag value common to all observed MBeans.- Specified by:
- setDifferenceModein interface- GaugeMonitorMBean
- Parameters:
- value- The difference mode flag value.
- See Also:
- getDifferenceMode()
 
 - 
getNotificationInfopublic MBeanNotificationInfo[] getNotificationInfo() Returns aNotificationInfoobject containing the name of the Java class of the notification and the notification types sent by the gauge monitor.- Specified by:
- getNotificationInfoin interface- NotificationBroadcaster
- Returns:
- the array of possible notifications.
 
 
- 
 
-