Save This Page
Home » openjdk-7 » javax » management » monitor » [javadoc | source]
javax.management.monitor
public class: GaugeMonitor [javadoc | source]
java.lang.Object
   javax.management.NotificationBroadcasterSupport
      javax.management.monitor.Monitor
         javax.management.monitor.GaugeMonitor

All Implemented Interfaces:
    GaugeMonitorMBean, MonitorMBean, MBeanRegistration, NotificationEmitter

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).
Nested Class Summary:
static class  GaugeMonitor.GaugeMonitorObservedObject   
Fields inherited from javax.management.monitor.Monitor:
capacityIncrement,  elementCount,  alreadyNotified,  alreadyNotifieds,  server,  RESET_FLAGS_ALREADY_NOTIFIED,  OBSERVED_OBJECT_ERROR_NOTIFIED,  OBSERVED_ATTRIBUTE_ERROR_NOTIFIED,  OBSERVED_ATTRIBUTE_TYPE_ERROR_NOTIFIED,  RUNTIME_ERROR_NOTIFIED,  dbgTag,  observedObjects,  THRESHOLD_ERROR_NOTIFIED,  INTEGER_ZERO
Constructor:
 public GaugeMonitor() 
Method from javax.management.monitor.GaugeMonitor Summary:
buildAlarmNotification,   createObservedObject,   getDerivedGauge,   getDerivedGauge,   getDerivedGaugeFromComparable,   getDerivedGaugeTimeStamp,   getDerivedGaugeTimeStamp,   getDifferenceMode,   getHighThreshold,   getLowThreshold,   getNotificationInfo,   getNotifyHigh,   getNotifyLow,   isComparableTypeValid,   isThresholdTypeValid,   onErrorNotification,   setDifferenceMode,   setNotifyHigh,   setNotifyLow,   setThresholds,   start,   stop
Methods from javax.management.monitor.Monitor:
addObservedObject,   buildAlarmNotification,   buildErrorNotification,   classForType,   computeAlreadyNotifiedIndex,   containsObservedObject,   createAlreadyNotified,   createObservedObject,   doStart,   doStop,   getAttribute,   getComparableFromAttribute,   getDerivedGauge,   getDerivedGaugeFromComparable,   getDerivedGaugeTimeStamp,   getGranularityPeriod,   getObservedAttribute,   getObservedObject,   getObservedObject,   getObservedObjects,   isActive,   isAlreadyNotified,   isComparableTypeValid,   isThresholdTypeValid,   isValidForType,   onErrorNotification,   postDeregister,   postRegister,   preDeregister,   preRegister,   removeObservedObject,   resetAllAlreadyNotified,   resetAlreadyNotified,   setAlreadyNotified,   setGranularityPeriod,   setObservedAttribute,   setObservedObject,   start,   stop,   updateAlreadyNotified,   updateDeprecatedAlreadyNotified
Methods from javax.management.NotificationBroadcasterSupport:
addNotificationListener,   getNotificationInfo,   handleNotification,   removeNotificationListener,   removeNotificationListener,   sendNotification
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from javax.management.monitor.GaugeMonitor Detail:
 synchronized MonitorNotification buildAlarmNotification(ObjectName object,
    String attribute,
    Comparable value) 
 ObservedObject createObservedObject(ObjectName object) 
    Factory method for ObservedObject creation.
 public synchronized Number getDerivedGauge() 
Deprecated! As - of JMX 1.2, replaced by #getDerivedGauge(ObjectName)

    Returns the derived gauge of the first object in the set of observed MBeans.
 public synchronized Number getDerivedGauge(ObjectName object) 
    Gets the derived gauge of the specified object, if this object is contained in the set of observed MBeans, or null otherwise.
 synchronized Comparable getDerivedGaugeFromComparable(ObjectName object,
    String attribute,
    Comparable value) 
 public synchronized long getDerivedGaugeTimeStamp() 
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 long getDerivedGaugeTimeStamp(ObjectName object) 
    Gets the derived gauge timestamp of the specified object, if this object is contained in the set of observed MBeans, or 0 otherwise.
 public synchronized boolean getDifferenceMode() 
    Gets the difference mode flag value common to all observed MBeans.
 public synchronized Number getHighThreshold() 
    Gets the high threshold value common to all observed MBeans.
 public synchronized Number getLowThreshold() 
    Gets the low threshold value common to all observed MBeans.
 public MBeanNotificationInfo[] getNotificationInfo() 
    Returns a NotificationInfo object containing the name of the Java class of the notification and the notification types sent by the gauge monitor.
 public synchronized boolean getNotifyHigh() 
    Gets the high notification's on/off switch value common to all observed MBeans.
 public synchronized boolean getNotifyLow() 
    Gets the low notification's on/off switch value common to all observed MBeans.
 synchronized boolean isComparableTypeValid(ObjectName object,
    String attribute,
    Comparable value) 
    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.
 synchronized boolean isThresholdTypeValid(ObjectName object,
    String attribute,
    Comparable value) 
    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.
 synchronized  void onErrorNotification(MonitorNotification notification) 
 public synchronized  void setDifferenceMode(boolean value) 
    Sets the difference mode flag value common to all observed MBeans.
 public synchronized  void setNotifyHigh(boolean value) 
    Sets the high notification's on/off switch value common to all observed MBeans.
 public synchronized  void setNotifyLow(boolean value) 
    Sets the low notification's on/off switch value common to all observed MBeans.
 public synchronized  void setThresholds(Number highValue,
    Number lowValue) throws IllegalArgumentException 
    Sets the high and the low threshold values common to all observed MBeans.
 public synchronized  void start() 
    Starts the gauge monitor.
 public synchronized  void stop() 
    Stops the gauge monitor.