Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

javax.management.monitor
Class CounterMonitor  view CounterMonitor download CounterMonitor.java

java.lang.Object
  extended byjavax.management.NotificationBroadcasterSupport
      extended byjavax.management.monitor.Monitor
          extended byjavax.management.monitor.CounterMonitor
All Implemented Interfaces:
CounterMonitorMBean, javax.management.MBeanRegistration, MonitorMBean, javax.management.NotificationBroadcaster, java.io.Serializable

public class CounterMonitor
extends Monitor
implements CounterMonitorMBean

The counter monitor service.

Revisions:

20020319 Adrian Brock:

20020326 Adrian Brock:

Version:
$Revision: 1.3 $

Nested Class Summary
 
Nested classes inherited from class javax.management.monitor.Monitor
 
Field Summary
private  java.lang.Number derivedGauge
          The derived gauge.
private  long derivedGaugeTimeStamp
          The derived gauge timeStamp.
(package private)  boolean differenceMode
          Difference mode.
(package private)  java.lang.Number initialThreshold
          The last stated threshold.
private  java.lang.Number lastValue
          The last value.
(package private)  java.lang.Number modulus
          The modulus.
(package private)  boolean notify
          Notify.
(package private)  java.lang.Number offset
          The offset.
(package private)  java.lang.Number threshold
          The threshold.
(package private)  int THRESHOLD_ERROR_NOTIFIED
          The threshold type error has been notified.
(package private)  int THRESHOLD_EXCEEDED_NOTIFIED
          The counter threshold exceeded has been notified.
 
Fields inherited from class javax.management.monitor.Monitor
active, alreadyNotified, dbgTag, granularityPeriod, objectName, OBSERVED_ATTRIBUTE_ERROR_NOTIFIED, OBSERVED_ATTRIBUTE_TYPE_ERROR_NOTIFIED, OBSERVED_OBJECT_ERROR_NOTIFIED, observedAttribute, observedObject, RESET_FLAGS_ALREADY_NOTIFIED, RUNTIME_ERROR_NOTIFIED, scheduler, server
 
Fields inherited from class javax.management.NotificationBroadcasterSupport
log
 
Constructor Summary
CounterMonitor()
          Default Constructor
 
Method Summary
(package private)  java.lang.Number add(java.lang.Number value1, java.lang.Number value2)
          Add two numbers together.
 java.lang.Number getDerivedGauge()
          Retrieves the derived gauge.
 long getDerivedGaugeTimeStamp()
          Retrieves the derived gauge timestamp.
 boolean getDifferenceMode()
          Retrieves the difference mode flag.
 java.lang.Number getModulus()
          Retrieves the modulus.
 javax.management.MBeanNotificationInfo[] getNotificationInfo()
           
 boolean getNotify()
          Retrieves the notify on/off switch.
 java.lang.Number getOffset()
          Retrieves the offset.
 java.lang.Number getThreshold()
          Retrieves the threshold.
(package private)  java.lang.Number getZero(java.lang.Number value)
          Get zero for the type passed.
(package private)  void monitor(javax.management.MBeanAttributeInfo attributeInfo, java.lang.Object value)
          Perform the monitor specific processing.
(package private)  void sendThresholdErrorNotification(java.lang.Object value)
          Send a threshold error event.
(package private)  void sendThresholdExceededNotification(java.lang.Object value)
          Send a threshold exceeded event.
 void setDifferenceMode(boolean value)
          Sets the difference mode flag.
 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.
(package private)  java.lang.Number sub(java.lang.Number value1, java.lang.Number value2)
          Subtract two numbers.
 
Methods inherited from class javax.management.monitor.Monitor
getGranularityPeriod, getObservedAttribute, getObservedObject, isActive, postDeregister, postRegister, preDeregister, preRegister, runMonitor, sendAttributeErrorNotification, sendAttributeTypeErrorNotification, sendNotification, sendObjectErrorNotification, sendRuntimeErrorNotification, setGranularityPeriod, setObservedAttribute, setObservedObject, stop
 
Methods inherited from class javax.management.NotificationBroadcasterSupport
addNotificationListener, getListenerMap, 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, stop
 

Field Detail

THRESHOLD_EXCEEDED_NOTIFIED

int THRESHOLD_EXCEEDED_NOTIFIED
The counter threshold exceeded has been notified.


THRESHOLD_ERROR_NOTIFIED

int THRESHOLD_ERROR_NOTIFIED
The threshold type error has been notified.


derivedGauge

private java.lang.Number derivedGauge
The derived gauge.


lastValue

private java.lang.Number lastValue
The last value.


derivedGaugeTimeStamp

private long derivedGaugeTimeStamp
The derived gauge timeStamp.


offset

java.lang.Number offset
The offset.


modulus

java.lang.Number modulus
The modulus.


threshold

java.lang.Number threshold
The threshold.


initialThreshold

java.lang.Number initialThreshold
The last stated threshold.


differenceMode

boolean differenceMode
Difference mode.


notify

boolean notify
Notify.

Constructor Detail

CounterMonitor

public CounterMonitor()
Default Constructor

Method Detail

getNotificationInfo

public javax.management.MBeanNotificationInfo[] getNotificationInfo()
Specified by:
getNotificationInfo in interface javax.management.NotificationBroadcaster

getDerivedGauge

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

Specified by:
getDerivedGauge in interface CounterMonitorMBean

getDerivedGaugeTimeStamp

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

Specified by:
getDerivedGaugeTimeStamp in interface CounterMonitorMBean

getDifferenceMode

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

Specified by:
getDifferenceMode in interface CounterMonitorMBean

setDifferenceMode

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

Specified by:
setDifferenceMode in interface CounterMonitorMBean

getModulus

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

Specified by:
getModulus in interface CounterMonitorMBean

setModulus

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

Specified by:
setModulus in interface CounterMonitorMBean

getNotify

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

Specified by:
getNotify in interface CounterMonitorMBean

setNotify

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

Specified by:
setNotify in interface CounterMonitorMBean

getOffset

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

Specified by:
getOffset in interface CounterMonitorMBean

setOffset

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

Specified by:
setOffset in interface CounterMonitorMBean

getThreshold

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

Specified by:
getThreshold in interface CounterMonitorMBean

setThreshold

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

Specified by:
setThreshold in interface CounterMonitorMBean

start

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

Specified by:
start in interface MonitorMBean
Overrides:
start in class Monitor

monitor

void monitor(javax.management.MBeanAttributeInfo attributeInfo,
             java.lang.Object value)
       throws java.lang.Exception
Description copied from class: Monitor
Perform the monitor specific processing.

Specified by:
monitor in class Monitor

getZero

java.lang.Number getZero(java.lang.Number value)
Get zero for the type passed.


add

java.lang.Number add(java.lang.Number value1,
                     java.lang.Number value2)
Add two numbers together.


sub

java.lang.Number sub(java.lang.Number value1,
                     java.lang.Number value2)
Subtract two numbers.


sendThresholdExceededNotification

void sendThresholdExceededNotification(java.lang.Object value)
Send a threshold exceeded event.

This is only performed when requested and it has not already been sent.


sendThresholdErrorNotification

void sendThresholdErrorNotification(java.lang.Object value)
Send a threshold error event.

This is only performed when requested and it has not already been sent.