|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.server.UnicastRemoteObject
org.ourgrid.common.rmi.OurgridUnicastRemoteObject
org.ourgrid.common.fd.AbstractFailureDetector
public abstract class AbstractFailureDetector
This object is responsible for providing an updated information about
Monitorable
s fails.
The rationale behind the abstract
is that the
Monitorable
interface methods will be implemented by the
failure detector. We plan three main implementors to this interface:
UserAgent
has three states. :-)
Shutdownable
,
Monitor
,
Monitorable
,
Serialized FormField Summary | |
---|---|
static java.lang.String |
BOUND_NAME
The name to be used to bound the remote service. |
static java.lang.String |
DEFAULT_PROTOCOL
|
static long |
serialVersionUID
Serial identification of the class. |
Fields inherited from class java.rmi.server.RemoteObject |
---|
ref |
Constructor Summary | |
---|---|
AbstractFailureDetector()
Initializes an AbstractFailureDetector with
AbstractFailureDetector#DEFAULT_QUERY_FREQUENCY |
|
AbstractFailureDetector(int queryFrequency)
Initializes an AbstractFailureDetector |
|
AbstractFailureDetector(int queryFrequency,
MonitoringUnitFactory factory)
|
|
AbstractFailureDetector(MonitoringUnitFactory factory)
|
Method Summary | |
---|---|
abstract GenericState |
getCurrentState()
Retrieves the monitorable current status. |
double |
getEncarnationNumber()
Return an unique identifier of the Monitorable session. |
protected java.lang.String |
getFailureDetectorAddress(java.lang.String monitorableAddress)
This method gets the address of the FailureDetector
service bounded at the same machine of the monitorable service given by
parameter. |
java.util.Map<java.lang.String,MonitoringUnit> |
getMonitorables()
Retrieves a collection of monitorables |
void |
pingNow(java.lang.String monitorableAddress)
|
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 |
setMonitorableState(java.lang.String monitorableAddress,
GenericState newState)
Allows that an external entity updates the state of a monitorable |
void |
shutdown()
Informs the service thread associated with the object that it must shutdown. |
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 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 |
Field Detail |
---|
public static final long serialVersionUID
public static final java.lang.String BOUND_NAME
public static final java.lang.String DEFAULT_PROTOCOL
Constructor Detail |
---|
public AbstractFailureDetector() throws java.rmi.RemoteException
AbstractFailureDetector
with
AbstractFailureDetector#DEFAULT_QUERY_FREQUENCY
java.rmi.RemoteException
- If something wrong occurs at the initialization
of the OurgridUnicastRemoteObject
public AbstractFailureDetector(MonitoringUnitFactory factory) throws java.rmi.RemoteException
java.rmi.RemoteException
public AbstractFailureDetector(int queryFrequency) throws java.rmi.RemoteException
AbstractFailureDetector
queryFrequency
- The frequency when the state of
Monitorable
objects will me verified.
java.rmi.RemoteException
- If something wrong occurs at the initialization
of the OurgridUnicastRemoteObject
public AbstractFailureDetector(int queryFrequency, MonitoringUnitFactory factory) throws java.rmi.RemoteException
java.rmi.RemoteException
Method Detail |
---|
public void register(Notifiable notifiable, java.lang.String monitorableAddress, boolean imediatePing) throws java.rmi.RemoteException, java.net.MalformedURLException
java.rmi.RemoteException
java.net.MalformedURLException
public void pingNow(java.lang.String monitorableAddress) throws java.rmi.RemoteException
java.rmi.RemoteException
public void register(Notifiable notifiable, java.lang.String monitorableAddress) throws java.rmi.RemoteException, java.net.MalformedURLException
Monitor
register
in interface Monitor
notifiable
- object interested in receiving the notificationsmonitorableAddress
- the address of the service (FailureDetector
..
Monitorable
) to monitor
java.net.MalformedURLException
- If has something wrong with monitorable
URL.
java.rmi.RemoteException
- if anything wrong occurs in communication.Monitor.register(org.ourgrid.common.fd.Notifiable,
String)
public void unregister(Notifiable notifiable) throws java.rmi.RemoteException
Monitor
unregister
in interface Monitor
notifiable
- the object to be removed
java.rmi.RemoteException
- if anything wrong occurs in communication.Monitor.unregister(org.ourgrid.common.fd.Notifiable)
public void unregister(Notifiable notifiable, java.lang.String monitorableAddress) throws java.rmi.RemoteException
Monitor
unregister
in interface Monitor
notifiable
- the object to be removedmonitorableAddress
- the Monitorable
address that the
Notifiable
will not be interested.
java.rmi.RemoteException
- if anything wrong occurs in communication.Monitor.unregister(org.ourgrid.common.fd.Notifiable,
String)
public void startMonitoring() throws java.rmi.RemoteException
pingerTimerTask
is initialized here because in certain
situations (e.g. Sensors) the monitoring will not occurs.
startMonitoring
in interface Monitor
java.rmi.RemoteException
- if anything wrong occurs in communication.Monitor.startMonitoring()
public java.util.Map<java.lang.String,MonitoringUnit> getMonitorables() throws java.rmi.RemoteException
Monitor
getMonitorables
in interface Monitor
java.rmi.RemoteException
- If anything wrong occurs in communication.Monitor.getMonitorables()
public double getEncarnationNumber() throws java.rmi.RemoteException
Monitorable
Monitorable
session.
getEncarnationNumber
in interface Monitorable
Monitorable
session.
java.rmi.RemoteException
- if anything wrong occurs in communication.Monitorable.getEncarnationNumber()
public void setMonitorableState(java.lang.String monitorableAddress, GenericState newState)
monitorableAddress
- newState
- protected java.lang.String getFailureDetectorAddress(java.lang.String monitorableAddress) throws java.net.MalformedURLException
FailureDetector
service bounded at the same machine of the monitorable service given by
parameter.
monitorableAddress
- The service the user would like to monitor
FailureDetector
service bounded
at the same machine of the monitorable service given by
parameter.
java.net.MalformedURLException
- If has something wrong with monitorable
URL.public void shutdown()
Shutdownable
shutdown
in interface Shutdownable
Shutdownable.shutdown()
public abstract GenericState getCurrentState() throws java.rmi.RemoteException
Monitorable
getCurrentState
in interface Monitorable
Monitorable
state.
java.rmi.RemoteException
- if anything wrong occurs in communication.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |