|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ourgrid.common.fd.MonitoringUnit
public class MonitoringUnit
Create to organize the monitoring action this class knows all information
necessary to monitor a Monitorable
.
We have the remote entity and an local state to recover at any time.
Field Summary | |
---|---|
static java.lang.String |
UNDEFINED_MONITORABLE_NAME
This is the name used when the MonitoringUnit does not
know (or can not get yet) the Monitorable name |
Constructor Summary | |
---|---|
MonitoringUnit(GenericState initialState,
java.lang.String remoteFailureDetectorAddress,
java.lang.String monitorableServiceIndex)
Constructor |
Method Summary | |
---|---|
void |
addInterested(java.lang.String notifiableName,
Notifiable notifiable)
Adds a Notifiable like interested in this
Monitorable . |
void |
changeState(GenericState newState)
The state should be changed by this method only |
java.lang.String |
getAddress()
Returns the object remote address. |
java.util.Map<java.lang.String,Notifiable> |
getInteresteds()
|
double |
getLastEncarnationNumber()
|
GenericState |
getLastState()
|
java.lang.String |
getMonitorableIdentifier()
An index name given by the Notifier when register it
interests to the Monitorable . |
protected Monitorable |
getSynchronizedRemoteReference()
This method is used to synchronize the reference the the MonitoringUnit has with the remote one. |
boolean |
hasInteresteds()
|
void |
removeInterested(java.lang.String notifiableName)
Remove a Notifiable like interested in this
Monitorable . |
void |
updateState()
Executes a call (note that call can be remote or local), asking to the Monitorable the new state. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String UNDEFINED_MONITORABLE_NAME
MonitoringUnit
does not
know (or can not get yet) the Monitorable
name
Constructor Detail |
---|
public MonitoringUnit(GenericState initialState, java.lang.String remoteFailureDetectorAddress, java.lang.String monitorableServiceIndex)
initialState
- The MonitoringUnit
initial stateremoteFailureDetectorAddress
- The address of the
MonitoringUnit
to be createdmonitorableServiceIndex
- An index name given by the
Notifier
when register it interests to the
Monitorable
. It will be used to notify that a
state has changed.Method Detail |
---|
public java.util.Map<java.lang.String,Notifiable> getInteresteds()
public GenericState getLastState()
public void addInterested(java.lang.String notifiableName, Notifiable notifiable)
Notifiable
like interested in this
Monitorable
.
notifiableName
- The name of the Notifiable
to be
used as key.notifiable
- The Notifiable
implementation.public void removeInterested(java.lang.String notifiableName)
Notifiable
like interested in this
Monitorable
.
notifiableName
- The Notifiable
namepublic boolean hasInteresteds()
Monitorable
at least one
Notifiable
interested.public void updateState()
Monitorable
the new state. If anything wrong occurs sets
the monitorable state to State.DOWN
Here, it is necessary
to getSynchronizedRemoteReference
when the object goes
down. This synchronization is necessary because the remote references are
modified at startup moment and old (deprecated) references could point to
wrong remote references.
getSynchronizedRemoteReference()
protected Monitorable getSynchronizedRemoteReference() throws java.rmi.RemoteException, java.net.MalformedURLException, java.rmi.NotBoundException
MonitoringUnit
has with the remote one.
java.rmi.RemoteException
- If could not contact the remote server
java.rmi.NotBoundException
- If the object in exported remotely.
java.net.MalformedURLException
- If the address is a not valid
RMI
url.public java.lang.String getAddress()
public double getLastEncarnationNumber()
MonitoringUnit
public void changeState(GenericState newState)
newState
- public java.lang.String getMonitorableIdentifier()
Notifier
when register it
interests to the Monitorable
.
Notifier
when register
it interests to the Monitorable
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |