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 Watch

    java.lang.Object
      org.jini.rio.watch.Watch

All Implemented Interfaces:
  WatchMBean

Direct Known Subclasses:
  ThresholdWatch

    public class Watch

extends Object
implements WatchMBean

The Watch provides a mechanism to collect information and associate it to a WatchDataSource

Field Summary
`static String` | `DEFAULT_VIEW` Default View class
`protected String` | `id` The identifier for this watch.
`protected WatchDataSourceImpl` | `localRef` The WatchDataSourceImpl, this may be null if not created by the Watch
`protected static Logger` | `logger` A Logger
`protected WatchDataSource` | `watchDataSource` The WatchDataSource associated with this Watch.

Constructor Summary
`Watch(String id)` Creates new Watch, creates and exports a WatchDataSourceImpl
`Watch(String id, Archivable archivable, Configuration config)` Creates new archivable Watch, creates and exports a WatchDataSourceImpl using the Configuration object provided
`Watch(String id, Configuration config)` Creates new Watch, creates and exports a WatchDataSourceImpl if the WatchDataSource is null using the Configuration object provided
`Watch(WatchDataSource watchDataSource, String id)` Creates new Watch

Method Summary
`void` | `addWatchRecord(Calculable calc)` Add a watch record to the history
`void` | `clear()` Clear the collected values
`boolean` | `equals(Object obj)` Indicates whether some other object is "equal to" this one.
`TabularData` | `getCalculables()` Get all collected Calculable values as TabularData
`String` | `getId()` Getter for property id.
`double` | `getLastCalculableValue()` Get the last Calculable as a CompositeData object
`String` | `getView()` Get the view for the Watch
`WatchDataSource` | `getWatchDataSource()` Getter for property watchDataSource.
`int` | `hashCode()` Returns a hash code value for the object.
`static void` | `main(String[] args)`
`void` | `setView(String viewClass)` Set the view for the Watch
`void` | `setWatchDataSource(WatchDataSource watchDataSource)` Sets the WatchDataSource for the Watch.
`String` | `toString()` Returns a string representation of the object.

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Field Detail

### watchDataSource

    protected WatchDataSource watchDataSource

  The WatchDataSource associated with this Watch.

### id

    protected String id

  The identifier for this watch.

### localRef

    protected WatchDataSourceImpl localRef

  The WatchDataSourceImpl, this may be null if not created by the Watch

### logger

    protected static final Logger logger

  A Logger

### DEFAULT_VIEW

    public static final String DEFAULT_VIEW

  Default View class

  See Also:
    Constant Field Values

Constructor Detail

### Watch

    public Watch(String id)

  Creates new Watch, creates and exports a WatchDataSourceImpl

  Parameters:
    `id` - The identifier for this watch

### Watch

    public Watch(String id,
                 Configuration config)

  Creates new Watch, 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

### Watch

    public Watch(String id,
                 Archivable archivable,
                 Configuration config)

  Creates new archivable Watch, creates and exports a WatchDataSourceImpl using the Configuration object provided

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

### Watch

    public Watch(WatchDataSource watchDataSource,
                 String id)

  Creates new Watch

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

Method Detail

### getWatchDataSource

    public WatchDataSource getWatchDataSource()

  Getter for property watchDataSource.

  Returns:
    Value of property watchDataSource.

### setWatchDataSource

    public void setWatchDataSource(WatchDataSource watchDataSource)

  Sets the WatchDataSource for the Watch. This will also set the local WatchDataSource reference to null

  Parameters:
    `watchDataSource` - The new watchDataSource.

### getView

    public String getView()

  Get the view for the Watch

  Returns:
    The view for the Watch

### setView

    public void setView(String viewClass)

  Set the view for the Watch

  Parameters:
    `viewClass` - Fully qualified classname, suitable for use with Class.forName(), of the class to use to visualize the Watch

### getId

    public String getId()

  Description copied from interface: `WatchMBean`
  Getter for property id.

  Specified by:
    `getId` in interface `WatchMBean`
  Returns:
    Value of property id.
  See Also:
    `WatchMBean.getId()`

### getLastCalculableValue

    public double getLastCalculableValue()

  Description copied from interface: `WatchMBean`
  Get the last Calculable as a CompositeData object

  Specified by:
    `getLastCalculableValue` in interface `WatchMBean`
  Returns:
    The last Calculable as a CompositeData object
  See Also:
    `WatchMBean.getLastCalculableValue()`

### getCalculables

    public TabularData getCalculables()

  Description copied from interface: `WatchMBean`
  Get all collected Calculable values as TabularData

  Specified by:
    `getCalculables` in interface `WatchMBean`
  Returns:
    All Calculable values as TabularData
  See Also:
    `WatchMBean.getCalculables()`

### clear

    public void clear()

  Description copied from interface: `WatchMBean`
  Clear the collected values

  Specified by:
    `clear` in interface `WatchMBean`
  See Also:
    `WatchMBean.clear()`

### addWatchRecord

    public void addWatchRecord(Calculable calc)

  Add a watch record to the history

  Parameters:
    `calc` - the Calculable record to be added

### equals

    public boolean equals(Object obj)

  Indicates whether some other object is "equal to" this one.

  Overrides:
    `equals` in class `Object`
  Parameters:
    `obj` - the object to compare to this one
  Returns:
    true if the objects are equal

### hashCode

    public int hashCode()

  Returns a hash code value for the object.

  Overrides:
    `hashCode` in class `Object`
  Returns:
    a hash code value for the object.

### toString

    public String toString()

  Returns a string representation of the object.

  Overrides:
    `toString` in class `Object`
  Returns:
    a string representation of the object.

### 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.