Rio Project 4.2 API Documentation



org.rioproject.watch
Class CounterWatch

java.lang.Object
  extended by org.rioproject.watch.Watch
      extended by org.rioproject.watch.ThresholdWatch
          extended by org.rioproject.watch.CounterWatch
All Implemented Interfaces:
CounterWatchMBean, ThresholdWatchMBean, WatchMBean

public class CounterWatch
extends ThresholdWatch
implements CounterWatchMBean

A CounterWatch provides a mechanism to count a monotonically increasing non-negative value of an arbitrary occurance of something over time


Field Summary
static String VIEW
           
 
Fields inherited from class org.rioproject.watch.Watch
COMPONENT, DEFAULT_VIEW, id, localRef, logger, watchDataSource
 
Constructor Summary
CounterWatch(String id)
          Create a new Counter Watch
CounterWatch(String id, Configuration config)
          Creates new CounterWatch, creates and exports a WatchDataSourceImpl if the WatchDataSource is null using the Configuration object provided
CounterWatch(WatchDataSource watchDataSource, String id)
          Create a new Counter Watch
 
Method Summary
 void decrement()
          Decrement the count by one
 void decrement(long value)
          Decrement the count
 long getCounter()
          Getter for property counter
 void increment()
          Increment the count by one
 void increment(long value)
          Increment the count
static void main(String[] args)
           
 void setCounter(long counter)
          Setter for property counter
 
Methods inherited from class org.rioproject.watch.ThresholdWatch
addThresholdListener, addWatchRecord, getBreachedCount, getClearedCount, getCurrentHighThreshold, getCurrentLowThreshold, getHighThreshold, getLowThreshold, getThresholdManager, getThresholdValues, removeThresholdListener, setCurrentHighThreshold, setCurrentLowThreshold, setThresholdValues
 
Methods inherited from class org.rioproject.watch.Watch
clear, equals, getCalculables, getId, getLastCalculableValue, getView, getWatchDataSource, hashCode, setView, setWatchDataSource, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.rioproject.watch.ThresholdWatchMBean
getBreachedCount, getClearedCount, getCurrentHighThreshold, getCurrentLowThreshold, getHighThreshold, getLowThreshold, setCurrentHighThreshold, setCurrentLowThreshold
 
Methods inherited from interface org.rioproject.watch.WatchMBean
clear, getCalculables, getId, getLastCalculableValue
 

Field Detail

VIEW

public static final String VIEW
See Also:
Constant Field Values
Constructor Detail

CounterWatch

public CounterWatch(String id)
Create a new Counter Watch

Parameters:
id - the identifier for this watch

CounterWatch

public CounterWatch(String id,
                    Configuration config)
Creates new CounterWatch, creates and exports a WatchDataSourceImpl if the WatchDataSource is null using the Configuration object provided

Parameters:
id - The identifier for this watch
config - Configuration object used for constructing a WatchDataSource

CounterWatch

public CounterWatch(WatchDataSource watchDataSource,
                    String id)
Create a new Counter Watch

Parameters:
watchDataSource - the watch data source associated with this watch
id - the identifier for this watch
Method Detail

getCounter

public long getCounter()
Description copied from interface: CounterWatchMBean
Getter for property counter

Specified by:
getCounter in interface CounterWatchMBean
Returns:
Value of property counter.
See Also:
CounterWatchMBean.getCounter()

setCounter

public void setCounter(long counter)
Description copied from interface: CounterWatchMBean
Setter for property counter

Specified by:
setCounter in interface CounterWatchMBean
Parameters:
counter - New value of property counter.
See Also:
CounterWatchMBean.setCounter(long)

increment

public void increment()
Description copied from interface: CounterWatchMBean
Increment the count by one

Specified by:
increment in interface CounterWatchMBean
See Also:
CounterWatchMBean.increment()

increment

public void increment(long value)
Description copied from interface: CounterWatchMBean
Increment the count

Specified by:
increment in interface CounterWatchMBean
Parameters:
value - the amount to increment the counter
See Also:
CounterWatchMBean.increment(long)

decrement

public void decrement()
Description copied from interface: CounterWatchMBean
Decrement the count by one

Specified by:
decrement in interface CounterWatchMBean
See Also:
CounterWatchMBean.decrement()

decrement

public void decrement(long value)
Description copied from interface: CounterWatchMBean
Decrement the count

Specified by:
decrement in interface CounterWatchMBean
Parameters:
value - the amount to decrement the counter
See Also:
CounterWatchMBean.decrement(long)

main

public static void main(String[] args)

Copyright © Rio Project.

Copyright © 2006-2011 Rio Project. All Rights Reserved.