Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Project Rio
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jini.rio.watch
Class CounterWatch

    java.lang.Object
      org.jini.rio.watch.Watch
          org.jini.rio.watch.ThresholdWatch
              org.jini.rio.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.jini.rio.watch.Watch
`DEFAULT_VIEW, id, localRef, logger, watchDataSource`

Constructor Summary
`CounterWatch(String id)` Create a new Counter Watch
`CounterWatch(String id, Archivable archivable, Configuration config)` Creates new CounterWatch, creates and exports a WatchDataSourceImpl if the WatchDataSource is null using the Configuration object provided
`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.jini.rio.watch.ThresholdWatch
`addThresholdListener, addWatchRecord, getBreachedCount, getClearedCount, getCurrentHighThreshold, getCurrentLowThreshold, getHighThreshold, getLowThreshold, getThresholdManager, getThresholdValues, removeThresholdListener, setCurrentHighThreshold, setCurrentLowThreshold, setThresholdValues`

Methods inherited from class org.jini.rio.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.jini.rio.watch.ThresholdWatchMBean
`getBreachedCount, getClearedCount, getCurrentHighThreshold, getCurrentLowThreshold, getHighThreshold, getLowThreshold, setCurrentHighThreshold, setCurrentLowThreshold`

Methods inherited from interface org.jini.rio.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(String id,
                        Archivable archivable,
                        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
    `archivable` - The Archivable
    `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)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Project Rio
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © Project Rio.