org.ourgrid.corepeer
Class FakeFailureDetector

java.lang.Object
  extended by java.rmi.server.RemoteObject
      extended by java.rmi.server.RemoteServer
          extended by java.rmi.server.UnicastRemoteObject
              extended by org.ourgrid.common.rmi.OurgridUnicastRemoteObject
                  extended by org.ourgrid.common.fd.AbstractFailureDetector
                      extended by org.ourgrid.corepeer.fd.CorePeerFailureDetector
                          extended by org.ourgrid.corepeer.FakeFailureDetector
All Implemented Interfaces:
java.io.Serializable, java.rmi.Remote, Shutdownable, Monitor, Monitorable

public class FakeFailureDetector
extends CorePeerFailureDetector

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.ourgrid.common.fd.AbstractFailureDetector
BOUND_NAME, DEFAULT_PROTOCOL
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
FakeFailureDetector(int queryFrequence)
           
 
Method Summary
 java.util.Map<java.lang.String,MonitoringUnit> getMonitorables()
          Retrieves a collection of monitorables
 void register(Notifiable notifiable, java.lang.String monitorableAddress)
          Adds an object interested in receiving Grid Machine state changes notifications of the specified Grid Machine.
 void register(Notifiable notifiable, java.lang.String monitorableAddress, boolean imediatePing)
           
 void startMonitoring()
          The pingerTimerTask is initialized here because in certain situations (e.g.
 void unregister(Notifiable notifiable)
          Removes the object interested in receiving Grid Machine state changes notifications of all monitorables interested list.
 void unregister(Notifiable notifiable, java.lang.String monitorableAddress)
          Removes the object interested in receiving Grid Machine state changes notifications.
 
Methods inherited from class org.ourgrid.corepeer.fd.CorePeerFailureDetector
getCurrentState
 
Methods inherited from class org.ourgrid.common.fd.AbstractFailureDetector
getEncarnationNumber, getFailureDetectorAddress, pingNow, setMonitorableState, shutdown
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FakeFailureDetector

public FakeFailureDetector(int queryFrequence)
                    throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException
Method Detail

register

public void register(Notifiable notifiable,
                     java.lang.String monitorableAddress)
              throws java.rmi.RemoteException,
                     java.net.MalformedURLException
Description copied from interface: Monitor
Adds an object interested in receiving Grid Machine state changes notifications of the specified Grid Machine.

Specified by:
register in interface Monitor
Overrides:
register in class AbstractFailureDetector
Parameters:
notifiable - object interested in receiving the notifications
monitorableAddress - the address of the service (FailureDetector .. Monitorable) to monitor
Throws:
java.rmi.RemoteException - if anything wrong occurs in communication.
java.net.MalformedURLException - If has something wrong with monitorable URL.
See Also:
Monitor.register(org.ourgrid.common.fd.Notifiable, String)

register

public void register(Notifiable notifiable,
                     java.lang.String monitorableAddress,
                     boolean imediatePing)
              throws java.rmi.RemoteException,
                     java.net.MalformedURLException
Overrides:
register in class AbstractFailureDetector
Throws:
java.rmi.RemoteException
java.net.MalformedURLException

unregister

public void unregister(Notifiable notifiable,
                       java.lang.String monitorableAddress)
                throws java.rmi.RemoteException
Description copied from interface: Monitor
Removes the object interested in receiving Grid Machine state changes notifications.

Specified by:
unregister in interface Monitor
Overrides:
unregister in class AbstractFailureDetector
Parameters:
notifiable - the object to be removed
monitorableAddress - the Monitorable address that the Notifiable will not be interested.
Throws:
java.rmi.RemoteException - if anything wrong occurs in communication.
See Also:
Monitor.unregister(org.ourgrid.common.fd.Notifiable, String)

unregister

public void unregister(Notifiable notifiable)
                throws java.rmi.RemoteException
Description copied from interface: Monitor
Removes the object interested in receiving Grid Machine state changes notifications of all monitorables interested list.

Specified by:
unregister in interface Monitor
Overrides:
unregister in class AbstractFailureDetector
Parameters:
notifiable - the object to be removed
Throws:
java.rmi.RemoteException - if anything wrong occurs in communication.
See Also:
Monitor.unregister(org.ourgrid.common.fd.Notifiable)

startMonitoring

public void startMonitoring()
                     throws java.rmi.RemoteException
Description copied from class: AbstractFailureDetector
The pingerTimerTask is initialized here because in certain situations (e.g. Sensors) the monitoring will not occurs.

Specified by:
startMonitoring in interface Monitor
Overrides:
startMonitoring in class AbstractFailureDetector
Throws:
java.rmi.RemoteException - if anything wrong occurs in communication.
See Also:
Monitor.startMonitoring()

getMonitorables

public java.util.Map<java.lang.String,MonitoringUnit> getMonitorables()
                                                               throws java.rmi.RemoteException
Description copied from interface: Monitor
Retrieves a collection of monitorables

Specified by:
getMonitorables in interface Monitor
Overrides:
getMonitorables in class AbstractFailureDetector
Returns:
The entities to be monitored
Throws:
java.rmi.RemoteException - If anything wrong occurs in communication.
See Also:
Monitor.getMonitorables()