All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.jaw.impl.agent.services.monitor.CounterMonitor

java.lang.Object
   |
   +----com.sun.jaw.impl.agent.services.monitor.Monitor
           |
           +----com.sun.jaw.impl.agent.services.monitor.CounterMonitor

public class CounterMonitor
extends Monitor
implements AlarmClockListener, Serializable
This class provides a simple implementation of a counter monitor.

A counter monitor is a monitor which observes an attribute which behaves as a counter. It has the basic property that the defined event notification is triggered when the value of the count becomes equal to or greater than the comparison level of the threshold. In addition, an offset mechanism is also available to allow particular counting intervals to be detected, as follows. If the offset value is not zero, whenever the threshold is triggered by the counter value reaching a comparison level, that comparison level is incremented by the offset value. This is regarded as taking place instantaneously, i.e. before the count is incremented. Thus, for each level, the threshold triggers an event notification every time the count increases by an interval equal to the offset value. If the counter we are monitoring wraps around when it reaches its maximum value then the modulus value needs to be set to that maximum value.

If the counter difference option is used, then the value of the derived gauge is calculated as the difference between the observed counter values for two successive observations. If this difference is negative then the value of the derived gauge is incremented by the value of the modulus.

The derived gauge value (V[t]) is calculated using the following method:

This implementation of the counter monitor requires the observed property to be of type Integer.

See Also:
Monitor, GaugeMonitor

Constructor Index

 o CounterMonitor()

Method Index

 o getComparisonLevel()
Returns the comparison level value.
 o getCounterDifferenceOnOff()
Returns the counter difference on/off flag.
 o getModulusValue()
Returns the modulus value.
 o getNotifyOnOff()
Returns the notifications on/off switch value.
 o getOffsetValue()
Returns the offset value.
 o getPreviousScanCounter()
Returns the previous scan counter.
 o getPreviousScanCounterInitialisedOnOff()
Returns the previous scan counter procedural status.
 o handleAlarmClock(AlarmClockEvent)
This handle will be called each time the alarm-clock has exceeded its timeout.
 o performStop()
Deactivates the CounterMonitor service.
 o setComparisonLevel(Integer)
Sets the comparison level value.
 o setCounterDifferenceOnOff(Boolean)
Sets the counter difference on/off flag.
 o setModulusValue(Integer)
Sets the modulus value.
 o setNotifyOnOff(Boolean)
Sets the notifications on/off switch value.
 o setOffsetValue(Integer)
Sets the offset value.

Constructors

 o CounterMonitor
 public CounterMonitor()

Methods

 o handleAlarmClock
 public void handleAlarmClock(AlarmClockEvent e)
This handle will be called each time the alarm-clock has exceeded its timeout.

Overrides:
handleAlarmClock in class Monitor
 o getComparisonLevel
 public Integer getComparisonLevel()
Returns the comparison level value.

 o setComparisonLevel
 public void setComparisonLevel(Integer level)
Sets the comparison level value.

 o getOffsetValue
 public Integer getOffsetValue()
Returns the offset value.

 o setOffsetValue
 public void setOffsetValue(Integer value)
Sets the offset value.

 o getNotifyOnOff
 public Boolean getNotifyOnOff()
Returns the notifications on/off switch value.

 o setNotifyOnOff
 public void setNotifyOnOff(Boolean value)
Sets the notifications on/off switch value.

 o getCounterDifferenceOnOff
 public Boolean getCounterDifferenceOnOff()
Returns the counter difference on/off flag.

 o setCounterDifferenceOnOff
 public void setCounterDifferenceOnOff(Boolean value)
Sets the counter difference on/off flag.

 o getPreviousScanCounter
 public Integer getPreviousScanCounter()
Returns the previous scan counter.

 o getPreviousScanCounterInitialisedOnOff
 public Boolean getPreviousScanCounterInitialisedOnOff()
Returns the previous scan counter procedural status.

 o getModulusValue
 public Integer getModulusValue()
Returns the modulus value.

 o setModulusValue
 public void setModulusValue(Integer modulus)
Sets the modulus value.

 o performStop
 public synchronized void performStop()
Deactivates the CounterMonitor service.

Overrides:
performStop in class Monitor

All Packages  Class Hierarchy  This Package  Previous  Next  Index