This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


javax.management.monitor
class GaugeMonitor

java.lang.Object extended by javax.management.NotificationBroadcasterSupport extended by javax.management.monitor.Monitor extended by javax.management.monitor.GaugeMonitor
All Implemented Interfaces:
MBeanRegistration, NotificationEmitter, GaugeMonitorMBean, MonitorMBean

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).


Field Summary
 
Fields inherited from class javax.management.monitor.Monitor
alreadyNotified, 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 Summary

          Default constructor.
 
Method Summary
 Number

          Returns the derived gauge of the first object in the set of observed MBeans.
 Number

          Gets the derived gauge of the specified object, if this object is contained in the set of observed MBeans, or null otherwise.
 long

          Gets the derived gauge timestamp of the first object in the set of observed MBeans.
 long

          Gets the derived gauge timestamp of the specified object, if this object is contained in the set of observed MBeans, or 0 otherwise.
 boolean

          Gets the difference mode flag value common to all observed MBeans.
 Number

          Gets the high threshold value common to all observed MBeans.
 Number

          Gets the low threshold value common to all observed MBeans.
 MBeanNotificationInfo[]

          Returns a NotificationInfo object containing the name of the Java class of the notification and the notification types sent by the gauge monitor.
 boolean

          Gets the high notification's on/off switch value common to all observed MBeans.
 boolean

          Gets the low notification's on/off switch value common to all observed MBeans.
 void
setDifferenceMode(boolean value)

          Sets the difference mode flag value common to all observed MBeans.
 void
setNotifyHigh(boolean value)

          Sets the high notification's on/off switch value common to all observed MBeans.
 void
setNotifyLow(boolean value)

          Sets the low notification's on/off switch value common to all observed MBeans.
 void
setThresholds(Number highValue, Number lowValue)

          Sets the high and the low threshold values common to all observed MBeans.
 void

          Starts the gauge monitor.
 void

          Stops the gauge monitor.
 
Methods inherited from class javax.management.monitor.Monitor
addObservedObject, containsObservedObject, getGranularityPeriod, getObservedAttribute, getObservedObject, getObservedObjects, isActive, postDeregister, postRegister, preDeregister, preRegister, removeObservedObject, setGranularityPeriod, setObservedAttribute, setObservedObject, start, stop
 
Methods inherited from class javax.management.NotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GaugeMonitor

public GaugeMonitor()
Default constructor.

Method Detail

getDerivedGauge

public synchronized Number getDerivedGauge()
Returns the derived gauge of the first object in the set of observed MBeans.

Returns:
The derived gauge.

getDerivedGauge

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.

Overrides:
getDerivedGauge in class Monitor
Parameters:
object - the name of the MBean.
Returns:
The derived gauge of the specified object.

getDerivedGaugeTimeStamp

public synchronized long getDerivedGaugeTimeStamp()
Gets the derived gauge timestamp of the first object in the set of observed MBeans.

Returns:
The derived gauge timestamp.

getDerivedGaugeTimeStamp

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.

Overrides:
getDerivedGaugeTimeStamp in class Monitor
Parameters:
object - the name of the object whose derived gauge timestamp is to be returned.
Returns:
The derived gauge timestamp of the specified object.

getDifferenceMode

public synchronized boolean getDifferenceMode()
Gets the difference mode flag value common to all observed MBeans.

Returns:
true if the difference mode is used, false otherwise.

getHighThreshold

public synchronized Number getHighThreshold()
Gets the high threshold value common to all observed MBeans.

Returns:
The high threshold value.

getLowThreshold

public synchronized Number getLowThreshold()
Gets the low threshold value common to all observed MBeans.

Returns:
The low threshold value.

getNotificationInfo

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.

Overrides:
getNotificationInfo in class NotificationBroadcasterSupport

getNotifyHigh

public synchronized boolean getNotifyHigh()
Gets the high notification's on/off switch value common to all observed MBeans.

Returns:
true if the gauge monitor notifies when exceeding the high threshold, false otherwise.

getNotifyLow

public synchronized boolean getNotifyLow()
Gets the low notification's on/off switch value common to all observed MBeans.

Returns:
true if the gauge monitor notifies when exceeding the low threshold, false otherwise.

setDifferenceMode

public synchronized void setDifferenceMode(boolean value)
Sets the difference mode flag value common to all observed MBeans.

Parameters:
value - The difference mode flag value.

setNotifyHigh

public synchronized void setNotifyHigh(boolean value)
Sets the high notification's on/off switch value common to all observed MBeans.

Parameters:
value - The high notification's on/off switch value.

setNotifyLow

public synchronized void setNotifyLow(boolean value)
Sets the low notification's on/off switch value common to all observed MBeans.

Parameters:
value - The low notification's on/off switch value.

setThresholds

public synchronized void setThresholds(Number highValue,
                                       Number lowValue)
                                throws IllegalArgumentException
Sets the high and the low threshold values common to all observed MBeans.

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.

start

public synchronized void start()
Starts the gauge monitor.

Overrides:
start in class Monitor

stop

public synchronized void stop()
Stops the gauge monitor.

Overrides:
stop in class Monitor


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention, which is derived from the offical documentation that contains this copyright notice:
Copyright 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
The official Sun™ documentation can be found here at http://java.sun.com/javase/6/docs/api/.