Rio Project 4.2 API Documentation



org.rioproject.watch
Class WatchDataSourceImpl

java.lang.Object
  extended by org.rioproject.watch.WatchDataSourceImpl
All Implemented Interfaces:
Remote, ServerProxyTrust, WatchDataSource

public class WatchDataSourceImpl
extends Object
implements WatchDataSource, ServerProxyTrust

The WatchDataSourceImpl provides support for the WatchDataSource interface. The WatchDataSourceImpl supports the following configuration entries; where each configuration entry name is associated with the component name org.rioproject.watch


Field Summary
protected static String COMPONENT
          Component for accessing configuration and getting a Logger
static int DEFAULT_COLLECTION_SIZE
          Defines the default history size
protected static Logger logger
          A suitable Logger
static int MAX_COLLECTION_SIZE
          Defines the default history max size
 
Constructor Summary
WatchDataSourceImpl()
          Create a WatchDataSourceImpl
WatchDataSourceImpl(String id, Configuration config)
          Constructs WatchDataSourceImpl object.
 
Method Summary
 void addCalculable(Calculable calculable)
          Add a Calculable record to the Calculable history
 boolean addWatchDataReplicator(WatchDataReplicator replicator)
          Add a WatchDataReplicator,
 void clear()
          Clears the history
 void close()
          Closes the watch data source and unexports it from the runtime
 WatchDataSource export()
          Export the WatchDataSourceImpl using a configured Exporter, defaulting to BasicJeriExporter
protected  void finalize()
          Make sure the archival file is closed before garbage collection
 Calculable[] getCalculable()
          Get all Calculable records from the Calculable history
 Calculable[] getCalculable(long from, long to)
          Get Calculable records from the Calculable history for the specified time range
 Calculable[] getCalculable(String id)
           
 int getCurrentSize()
          Get the current size for the Calculable history
 String getID()
          Get the ID for the WatchDataSource
 Calculable getLastCalculable()
          Gets the last Calculable from the history
 int getMaxSize()
          Get the maximum size for the Calculable history
 WatchDataSource getProxy()
          Get the WatchDataSource proxy
 TrustVerifier getProxyVerifier()
          Returns a TrustVerifier which can be used to verify that a given proxy to this WatchDataSource can be trusted
 ThresholdValues getThresholdValues()
          Getter for property thresholdValues.
 String getView()
          Getter for property view.
 WatchDataReplicator[] getWatchDataReplicators()
           
 void initialize()
          Initialize the WatchDataSource
 boolean removeWatchDataReplicator(WatchDataReplicator replicator)
          Remove a WatchDataReplicator
 void setConfiguration(Configuration config)
          Set the WatchDataSource configuration
 void setID(String id)
          Setter for property id.
 void setMaxSize(int size)
          Set the maximum size for the Calculable history
 void setThresholdValues(ThresholdValues tValues)
          Set the ThresholdValues
 void setView(String viewClass)
          Setter for property view.
 void unexport(boolean force)
          Unexport the WatchDataSourceImpl
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_COLLECTION_SIZE

public static final int DEFAULT_COLLECTION_SIZE
Defines the default history size

See Also:
Constant Field Values

MAX_COLLECTION_SIZE

public static final int MAX_COLLECTION_SIZE
Defines the default history max size

See Also:
Constant Field Values

COMPONENT

protected static final String COMPONENT
Component for accessing configuration and getting a Logger

See Also:
Constant Field Values

logger

protected static Logger logger
A suitable Logger

Constructor Detail

WatchDataSourceImpl

public WatchDataSourceImpl()
Create a WatchDataSourceImpl


WatchDataSourceImpl

public WatchDataSourceImpl(String id,
                           Configuration config)
Constructs WatchDataSourceImpl object.

Parameters:
id - The ID of the WatchDataSource
config - Configuration object for use
Method Detail

initialize

public void initialize()
                throws RemoteException
Description copied from interface: WatchDataSource
Initialize the WatchDataSource

Specified by:
initialize in interface WatchDataSource
Throws:
RemoteException - if the WatchDataSource cannot be exported

export

public WatchDataSource export()
                       throws RemoteException
Export the WatchDataSourceImpl using a configured Exporter, defaulting to BasicJeriExporter

Returns:
A proxy to use for the WatchDataSource
Throws:
RemoteException - if there are errors exporting the WatchDataSource

getProxy

public WatchDataSource getProxy()
Get the WatchDataSource proxy

Returns:
The WatchDataSource proxy

setConfiguration

public void setConfiguration(Configuration config)
Description copied from interface: WatchDataSource
Set the WatchDataSource configuration

Specified by:
setConfiguration in interface WatchDataSource
Parameters:
config - The configuration

unexport

public void unexport(boolean force)
Unexport the WatchDataSourceImpl

Parameters:
force - If true, unexports the WatchDataSourceImpl even if there are pending or in-progress calls; if false, only unexports the WatchDataSourceImpl if there are no pending or in-progress calls

getID

public String getID()
Description copied from interface: WatchDataSource
Get the ID for the WatchDataSource

Specified by:
getID in interface WatchDataSource
Returns:
The identifier for the WatchDataSource
See Also:
WatchDataSource.getID()

setID

public void setID(String id)
Setter for property id.

Specified by:
setID in interface WatchDataSource
Parameters:
id - New value of property id.

setMaxSize

public void setMaxSize(int size)
Description copied from interface: WatchDataSource
Set the maximum size for the Calculable history

Specified by:
setMaxSize in interface WatchDataSource
Parameters:
size - The maximum size for the Calculable history
See Also:
WatchDataSource.setMaxSize(int)

clear

public void clear()
Description copied from interface: WatchDataSource
Clears the history

Specified by:
clear in interface WatchDataSource
See Also:
WatchDataSource.clear()

getMaxSize

public int getMaxSize()
Description copied from interface: WatchDataSource
Get the maximum size for the Calculable history

Specified by:
getMaxSize in interface WatchDataSource
Returns:
The maximum size for the Calculable history
See Also:
WatchDataSource.getMaxSize()

getCurrentSize

public int getCurrentSize()
Description copied from interface: WatchDataSource
Get the current size for the Calculable history

Specified by:
getCurrentSize in interface WatchDataSource
Returns:
The current size for the Calculable history
See Also:
WatchDataSource.getCurrentSize()

addCalculable

public void addCalculable(Calculable calculable)
Description copied from interface: WatchDataSource
Add a Calculable record to the Calculable history

Specified by:
addCalculable in interface WatchDataSource
Parameters:
calculable - The Calculable record
See Also:
WatchDataSource.addCalculable(org.rioproject.watch.Calculable)

getCalculable

public Calculable[] getCalculable()
Description copied from interface: WatchDataSource
Get all Calculable records from the Calculable history

Specified by:
getCalculable in interface WatchDataSource
Returns:
An array of Calculable records from the Calculable history. If there are no Calculable records in the history, a zero-length array will be returned
See Also:
WatchDataSource.getCalculable()

getCalculable

public Calculable[] getCalculable(String id)
See Also:
WatchDataSource.getCalculable()

getCalculable

public Calculable[] getCalculable(long from,
                                  long to)
Description copied from interface: WatchDataSource
Get Calculable records from the Calculable history for the specified time range

Specified by:
getCalculable in interface WatchDataSource
Parameters:
from - The start time
to - The end time
Returns:
An array of Calculable records from the Calculable history within the provided time range. If there are no Calculable records in the range, a zero-length array will be returned
See Also:
WatchDataSource.getCalculable(long, long)

getLastCalculable

public Calculable getLastCalculable()
Description copied from interface: WatchDataSource
Gets the last Calculable from the history

Specified by:
getLastCalculable in interface WatchDataSource
Returns:
The last Calculable in the history
See Also:
WatchDataSource.getLastCalculable()

finalize

protected void finalize()
                 throws Throwable
Make sure the archival file is closed before garbage collection

Overrides:
finalize in class Object
Throws:
Throwable

getThresholdValues

public ThresholdValues getThresholdValues()
Description copied from interface: WatchDataSource
Getter for property thresholdValues.

Specified by:
getThresholdValues in interface WatchDataSource
Returns:
Value of property thresholdValues.
See Also:
WatchDataSource.getThresholdValues()

setThresholdValues

public void setThresholdValues(ThresholdValues tValues)
Description copied from interface: WatchDataSource
Set the ThresholdValues

Specified by:
setThresholdValues in interface WatchDataSource
Parameters:
tValues - The ThresholdValues to set
See Also:
WatchDataSource.setThresholdValues(org.rioproject.watch.ThresholdValues)

close

public void close()
Description copied from interface: WatchDataSource
Closes the watch data source and unexports it from the runtime

Specified by:
close in interface WatchDataSource
See Also:
WatchDataSource.close()

setView

public void setView(String viewClass)
Description copied from interface: WatchDataSource
Setter for property view.

Specified by:
setView in interface WatchDataSource
Parameters:
viewClass - The view class name, suitable for Class.forName
See Also:
WatchDataSource.setView(java.lang.String)

getView

public String getView()
Description copied from interface: WatchDataSource
Getter for property view.

Specified by:
getView in interface WatchDataSource
Returns:
The Value of the property view
See Also:
WatchDataSource.getView()

getProxyVerifier

public TrustVerifier getProxyVerifier()
Returns a TrustVerifier which can be used to verify that a given proxy to this WatchDataSource can be trusted

Specified by:
getProxyVerifier in interface ServerProxyTrust

addWatchDataReplicator

public boolean addWatchDataReplicator(WatchDataReplicator replicator)
Description copied from interface: WatchDataSource
Add a WatchDataReplicator,

Specified by:
addWatchDataReplicator in interface WatchDataSource
Parameters:
replicator - The WatchDataReplicator to add.
Returns:
true if the WatchDataReplicator was added. If the WatchDataReplicator has already been added, it will not be added again.

removeWatchDataReplicator

public boolean removeWatchDataReplicator(WatchDataReplicator replicator)
Description copied from interface: WatchDataSource
Remove a WatchDataReplicator

Specified by:
removeWatchDataReplicator in interface WatchDataSource
Parameters:
replicator - The WatchDataReplicator to remove.
Returns:
true if the WatchDataReplicator was removed

getWatchDataReplicators

public WatchDataReplicator[] getWatchDataReplicators()

Copyright © Rio Project.

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