javax.management.monitor
Class CounterMonitor

java.lang.Object
  extended byjavax.management.NotificationBroadcasterSupport (src) 
      extended byjavax.management.monitor.Monitor (src) 
          extended byjavax.management.monitor.CounterMonitor
All Implemented Interfaces:
CounterMonitorMBean (src) , MBeanRegistration (src) , MonitorMBean (src) , NotificationBroadcaster (src) , NotificationEmitter (src)

public class CounterMonitor
extends Monitor (src)
implements CounterMonitorMBean (src)

The counter monitor service.

Revisions:

20020319 Adrian Brock:

20020326 Adrian Brock:


Field Summary
 
Fields inherited from class javax.management.monitor.Monitor (src)
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
CounterMonitor()
          Default Constructor
 
Method Summary
 java.lang.Number getDerivedGauge()
          Retrieves the derived gauge.
 java.lang.Number getDerivedGauge(ObjectName (src)  name)
          Retrieves the derived gauge.
 long getDerivedGaugeTimeStamp()
          Retrieves the derived gauge timestamp.
 long getDerivedGaugeTimeStamp(ObjectName (src)  name)
          Retrieves the derived gauge timestamp.
 boolean getDifferenceMode()
          Retrieves the difference mode flag.
 java.lang.Number getInitThreshold()
          Retrieves the initial threshold.
 java.lang.Number getModulus()
          Retrieves the modulus.
 MBeanNotificationInfo (src) [] getNotificationInfo()
          Returns the notification metadata associated with the MBean.
 boolean getNotify()
          Retrieves the notify on/off switch.
 java.lang.Number getOffset()
          Retrieves the offset.
 java.lang.Number getThreshold()
          Retrieves the threshold.
 java.lang.Number getThreshold(ObjectName (src)  name)
          Retrieves the threshold.
 void setDifferenceMode(boolean value)
          Sets the difference mode flag.
 void setInitThreshold(java.lang.Number threshold)
          Sets the initial threshold.
 void setModulus(java.lang.Number value)
          Sets the modulus.
 void setNotify(boolean value)
          Sets the notify on/off switch.
 void setOffset(java.lang.Number value)
          Sets the offset.
 void setThreshold(java.lang.Number value)
          Sets the threshold.
 void start()
          Starts the monitor.
 void stop()
          Stops the monitor.
 
Methods inherited from class javax.management.monitor.Monitor (src)
addObservedObject, containsObservedObject, getGranularityPeriod, getObservedAttribute, getObservedObject, getObservedObjects, isActive, postDeregister, postRegister, preDeregister, preRegister, removeObservedObject, setGranularityPeriod, setObservedAttribute, setObservedObject, toString
 
Methods inherited from class javax.management.NotificationBroadcasterSupport (src)
addNotificationListener, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.management.monitor.MonitorMBean (src)
addObservedObject, containsObservedObject, getGranularityPeriod, getObservedAttribute, getObservedObject, getObservedObjects, isActive, removeObservedObject, setGranularityPeriod, setObservedAttribute, setObservedObject
 

Constructor Detail

CounterMonitor

public CounterMonitor()
Default Constructor

Method Detail

getNotificationInfo

public MBeanNotificationInfo (src) [] getNotificationInfo()
Description copied from interface: NotificationBroadcaster (src)
Returns the notification metadata associated with the MBean.

Specified by:
getNotificationInfo in interface NotificationBroadcaster (src)
Overrides:
getNotificationInfo in class NotificationBroadcasterSupport (src)

getDerivedGauge

public java.lang.Number getDerivedGauge()
Description copied from interface: CounterMonitorMBean (src)
Retrieves the derived gauge.

Specified by:
getDerivedGauge in interface CounterMonitorMBean (src)
Returns:
the derived gauge.

getDerivedGauge

public java.lang.Number getDerivedGauge(ObjectName (src)  name)
Description copied from interface: CounterMonitorMBean (src)
Retrieves the derived gauge.

Specified by:
getDerivedGauge in interface CounterMonitorMBean (src)
Parameters:
name - the object name of the mbean.
Returns:
the derived gauge.

getDerivedGaugeTimeStamp

public long getDerivedGaugeTimeStamp()
Description copied from interface: CounterMonitorMBean (src)
Retrieves the derived gauge timestamp.

Specified by:
getDerivedGaugeTimeStamp in interface CounterMonitorMBean (src)
Returns:
the derived gauge timestamp.

getDerivedGaugeTimeStamp

public long getDerivedGaugeTimeStamp(ObjectName (src)  name)
Description copied from interface: CounterMonitorMBean (src)
Retrieves the derived gauge timestamp.

Specified by:
getDerivedGaugeTimeStamp in interface CounterMonitorMBean (src)
Parameters:
name - the object name of the mbean.
Returns:
the derived gauge timestamp.

getDifferenceMode

public boolean getDifferenceMode()
Description copied from interface: CounterMonitorMBean (src)
Retrieves the difference mode flag.

Specified by:
getDifferenceMode in interface CounterMonitorMBean (src)
Returns:
true when in difference mode, false otherwise.

setDifferenceMode

public void setDifferenceMode(boolean value)
Description copied from interface: CounterMonitorMBean (src)
Sets the difference mode flag.

Specified by:
setDifferenceMode in interface CounterMonitorMBean (src)
Parameters:
value - pass true for difference mode, false otherwise.

getInitThreshold

public java.lang.Number getInitThreshold()
Description copied from interface: CounterMonitorMBean (src)
Retrieves the initial threshold.

Specified by:
getInitThreshold in interface CounterMonitorMBean (src)
Returns:
the initial threshold.

setInitThreshold

public void setInitThreshold(java.lang.Number threshold)
                      throws java.lang.IllegalArgumentException
Description copied from interface: CounterMonitorMBean (src)
Sets the initial threshold.

Specified by:
setInitThreshold in interface CounterMonitorMBean (src)
Parameters:
threshold - the initial threshold.
Throws:
java.lang.IllegalArgumentException

getModulus

public java.lang.Number getModulus()
Description copied from interface: CounterMonitorMBean (src)
Retrieves the modulus.

Specified by:
getModulus in interface CounterMonitorMBean (src)
Returns:
the modulus value, zero means no modulus.

setModulus

public void setModulus(java.lang.Number value)
                throws java.lang.IllegalArgumentException
Description copied from interface: CounterMonitorMBean (src)
Sets the modulus.

Specified by:
setModulus in interface CounterMonitorMBean (src)
Parameters:
value - the modulus value, pass zero for no modulus.
Throws:
java.lang.IllegalArgumentException - when the modulus is null or less than zero.

getNotify

public boolean getNotify()
Description copied from interface: CounterMonitorMBean (src)
Retrieves the notify on/off switch.

Specified by:
getNotify in interface CounterMonitorMBean (src)
Returns:
true if notifications occur, false otherwise.

setNotify

public void setNotify(boolean value)
Description copied from interface: CounterMonitorMBean (src)
Sets the notify on/off switch.

Specified by:
setNotify in interface CounterMonitorMBean (src)
Parameters:
value - pass true notifications, false otherwise.

getOffset

public java.lang.Number getOffset()
Description copied from interface: CounterMonitorMBean (src)
Retrieves the offset.

Specified by:
getOffset in interface CounterMonitorMBean (src)
Returns:
the offset value, zero means no offset.

setOffset

public void setOffset(java.lang.Number value)
               throws java.lang.IllegalArgumentException
Description copied from interface: CounterMonitorMBean (src)
Sets the offset.

Specified by:
setOffset in interface CounterMonitorMBean (src)
Parameters:
value - the offset value, pass zero for no offset.
Throws:
java.lang.IllegalArgumentException - when the offset is null or less than zero.

getThreshold

public java.lang.Number getThreshold()
Description copied from interface: CounterMonitorMBean (src)
Retrieves the threshold.

Specified by:
getThreshold in interface CounterMonitorMBean (src)
Returns:
the threshold.

getThreshold

public java.lang.Number getThreshold(ObjectName (src)  name)
Description copied from interface: CounterMonitorMBean (src)
Retrieves the threshold.

Specified by:
getThreshold in interface CounterMonitorMBean (src)
Parameters:
name - the object name of the mbean.
Returns:
the threshold.

setThreshold

public void setThreshold(java.lang.Number value)
                  throws java.lang.IllegalArgumentException
Description copied from interface: CounterMonitorMBean (src)
Sets the threshold.

Specified by:
setThreshold in interface CounterMonitorMBean (src)
Parameters:
value - the threshold value, pass zero for no threshold.
Throws:
java.lang.IllegalArgumentException - when the threshold is null or less than zero.

start

public void start()
Description copied from interface: MonitorMBean (src)
Starts the monitor.

Specified by:
start in interface MonitorMBean (src)
Specified by:
start in class Monitor (src)

stop

public void stop()
Description copied from interface: MonitorMBean (src)
Stops the monitor.

Specified by:
stop in interface MonitorMBean (src)
Specified by:
stop in class Monitor (src)