org.ourgrid.common.fd
Class FakeMonitoringUnit

java.lang.Object
  extended by org.ourgrid.common.fd.MonitoringUnit
      extended by org.ourgrid.common.fd.FakeMonitoringUnit

public class FakeMonitoringUnit
extends MonitoringUnit

Fake class used to test. At constructor, the user can set a Monitorable that every call to getSynchronizedRemoteReference returns this reference.


Field Summary
 
Fields inherited from class org.ourgrid.common.fd.MonitoringUnit
UNDEFINED_MONITORABLE_NAME
 
Constructor Summary
FakeMonitoringUnit(GenericState initialState, java.lang.String remoteFailureDetectorAddress, java.lang.String monitorableServiceIndex)
          Constructor
FakeMonitoringUnit(GenericState initialState, java.lang.String monitorableAddress, java.lang.String monitorableServiceIndex, Monitorable monitorable)
          Constructor
 
Method Summary
protected  Monitorable getSynchronizedRemoteReference()
          This method is used to synchronize the reference the the MonitoringUnit has with the remote one.
 
Methods inherited from class org.ourgrid.common.fd.MonitoringUnit
addInterested, changeState, getAddress, getInteresteds, getLastEncarnationNumber, getLastState, getMonitorableIdentifier, hasInteresteds, removeInterested, updateState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FakeMonitoringUnit

public FakeMonitoringUnit(GenericState initialState,
                          java.lang.String remoteFailureDetectorAddress,
                          java.lang.String monitorableServiceIndex)
Constructor

Parameters:
initialState - The MonitoringUnit initial state
remoteFailureDetectorAddress - The address The key

FakeMonitoringUnit

public FakeMonitoringUnit(GenericState initialState,
                          java.lang.String monitorableAddress,
                          java.lang.String monitorableServiceIndex,
                          Monitorable monitorable)
Constructor

Parameters:
initialState - The MonitoringUnit initial state
monitorableAddress - The address The key
monitorable - The monitorable reference to be returned at every call to getSynchronizedRemoteReference method.
Method Detail

getSynchronizedRemoteReference

protected Monitorable getSynchronizedRemoteReference()
                                              throws java.rmi.RemoteException,
                                                     java.net.MalformedURLException,
                                                     java.rmi.NotBoundException
Description copied from class: MonitoringUnit
This method is used to synchronize the reference the the MonitoringUnit has with the remote one.

Overrides:
getSynchronizedRemoteReference in class MonitoringUnit
Returns:
A synchronized object remote reference.
Throws:
java.rmi.RemoteException - If could not contact the remote server
java.net.MalformedURLException - If the address is a not valid RMI url.
java.rmi.NotBoundException - If the object in exported remotely.