com.sun.jaw.impl.agent.services.monitor
Class 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, java.io.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, Serialized Form

Fields inherited from class com.sun.jaw.impl.agent.services.monitor.Monitor
administrativeStateOnOff, alarmClock, already_notified, ALREADY_NOTIFIED_FLAGS_CLEARED, cmf, derivedGauge, derivedGaugeTimestamp, event_type, GRANULARITY_PERIOD_ALREADY_NOTIFIED, granularityPeriod, listeners, OBSERVED_OBJECT_ALREADY_NOTIFIED, OBSERVED_PROPERTY_ALREADY_NOTIFIED, OBSERVED_PROPERTY_TYPE_ALREADY_NOTIFIED, observedObject, observedProperty
 
Constructor Summary
CounterMonitor()
           
 
Method Summary
 java.lang.Integer getComparisonLevel()
          Returns the comparison level value.
 java.lang.Boolean getCounterDifferenceOnOff()
          Returns the counter difference on/off flag.
 java.lang.Integer getModulusValue()
          Returns the modulus value.
 java.lang.Boolean getNotifyOnOff()
          Returns the notifications on/off switch value.
 java.lang.Integer getOffsetValue()
          Returns the offset value.
 java.lang.Integer getPreviousScanCounter()
          Returns the previous scan counter.
 java.lang.Boolean getPreviousScanCounterInitialisedOnOff()
          Returns the previous scan counter procedural status.
 void handleAlarmClock(AlarmClockEvent e)
          This handle will be called each time the alarm-clock has exceeded its timeout.
 void performStop()
          Deactivates the CounterMonitor service.
 void setComparisonLevel(java.lang.Integer level)
          Sets the comparison level value.
 void setCounterDifferenceOnOff(java.lang.Boolean value)
          Sets the counter difference on/off flag.
 void setModulusValue(java.lang.Integer modulus)
          Sets the modulus value.
 void setNotifyOnOff(java.lang.Boolean value)
          Sets the notifications on/off switch value.
 void setOffsetValue(java.lang.Integer value)
          Sets the offset value.
 
Methods inherited from class com.sun.jaw.impl.agent.services.monitor.Monitor
addMonitorListener, deleteCmf, getClassVersion, getDerivedGauge, getDerivedGaugeTimestamp, getGranularityPeriod, getGranularityPeriodAsLong, getObservedObject, getObservedProperty, initCmf, isActive, notifyMonitor, performStart, removeMonitorListener, setGranularityPeriod, setGranularityPeriodAsLong, setObservedObject, setObservedProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CounterMonitor

public CounterMonitor()
Method Detail

handleAlarmClock

public void handleAlarmClock(AlarmClockEvent e)
This handle will be called each time the alarm-clock has exceeded its timeout.
Specified by:
handleAlarmClock in interface AlarmClockListener
Overrides:
handleAlarmClock in class Monitor

getComparisonLevel

public java.lang.Integer getComparisonLevel()
Returns the comparison level value.

setComparisonLevel

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

getOffsetValue

public java.lang.Integer getOffsetValue()
Returns the offset value.

setOffsetValue

public void setOffsetValue(java.lang.Integer value)
Sets the offset value.

getNotifyOnOff

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

setNotifyOnOff

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

getCounterDifferenceOnOff

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

setCounterDifferenceOnOff

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

getPreviousScanCounter

public java.lang.Integer getPreviousScanCounter()
Returns the previous scan counter.

getPreviousScanCounterInitialisedOnOff

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

getModulusValue

public java.lang.Integer getModulusValue()
Returns the modulus value.

setModulusValue

public void setModulusValue(java.lang.Integer modulus)
Sets the modulus value.

performStop

public void performStop()
Deactivates the CounterMonitor service.
Overrides:
performStop in class Monitor