org.ourgrid.common.fd
Class SimpleTestFailureDetector
java.lang.Object
java.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.server.UnicastRemoteObject
org.ourgrid.common.rmi.OurgridUnicastRemoteObject
org.ourgrid.common.fd.AbstractFailureDetector
org.ourgrid.common.fd.SimpleTestFailureDetector
- All Implemented Interfaces:
- java.io.Serializable, java.rmi.Remote, Shutdownable, Monitor, Monitorable
public class SimpleTestFailureDetector
- extends AbstractFailureDetector
- See Also:
- Serialized Form
Fields inherited from class java.rmi.server.RemoteObject |
ref |
Methods inherited from class org.ourgrid.common.fd.AbstractFailureDetector |
getEncarnationNumber, getFailureDetectorAddress, getMonitorables, pingNow, register, register, setMonitorableState, shutdown, startMonitoring, unregister, unregister |
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 |
SimpleTestFailureDetector
public SimpleTestFailureDetector(MonitoringUnitFactory factory)
throws java.rmi.RemoteException
- Parameters:
factory
- The MonitoringUnitFactory
to be used.
- Throws:
java.rmi.RemoteException
- If anything wrong occurs.
SimpleTestFailureDetector
public SimpleTestFailureDetector(int queryFrequency)
throws java.rmi.RemoteException
- Constructor
- Parameters:
queryFrequency
- The verification frequency.
- Throws:
java.rmi.RemoteException
- If anything wrong occurs.
getCurrentState
public GenericState getCurrentState()
throws java.rmi.RemoteException
- Description copied from interface:
Monitorable
- Retrieves the monitorable current status.
- Specified by:
getCurrentState
in interface Monitorable
- Specified by:
getCurrentState
in class AbstractFailureDetector
- Returns:
- the
Monitorable
state.
- Throws:
java.rmi.RemoteException
- if anything wrong occurs in communication.
startMonitoring
public void startMonitoring(int numberOfVerfications)
throws java.rmi.RemoteException
- This is a ThreadSafe implementation of
startMonitoring
method. This method makes
numberOfVerfications
verifications respecting the thread
order. The second verification only will starts when the first terminates
and so on. The method only finishes after all threads of all iterations
have finished.
Notice that this method does not take the time in count. The
QueryFrequency
is ignored here.
- Parameters:
numberOfVerfications
- The number of verification iterations.
- Throws:
java.rmi.RemoteException
- If anything wrong occurs.- See Also:
ThreadServices
,
ThreadServices.waitUntilWorkIsDone()