|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface WatchdogServer
A remote interface for contacting the Watchdog server.
| Method Summary | |
|---|---|
long |
currentAppTimeMillis()
Returns the global application time in milliseconds as it is maintained by the central node. |
void |
recoveredNode(long nodeId,
long backupId)
Notifies this watchdog that the node with the specified nodeId has been recovered by the node with the specified
backupId. |
long |
registerNode(long nodeId,
String host,
WatchdogClient client,
int jmxPort)
Registers a node with the corresponding nodeId, host,
and client, and returns the interval (in milliseconds) that this
watchdog must be notified, via the renewNode method,
in order for the specified node to be considered alive. |
boolean |
renewNode(long nodeId)
Notifies this watchdog that the node with the specified nodeId is alive. |
void |
setNodeHealth(long nodeId,
boolean isLocal,
Node.Health health,
String component,
int maxNumberOfAttempts)
Notifies the node with the given ID that its health has been set. |
| Method Detail |
|---|
long registerNode(long nodeId,
String host,
WatchdogClient client,
int jmxPort)
throws NodeRegistrationFailedException,
IOException
nodeId, host,
and client, and returns the interval (in milliseconds) that this
watchdog must be notified, via the renewNode method,
in order for the specified node to be considered alive.
If this method throws NodeRegistrationFailedException,
the caller should not retry as this indicates a fatal error.
When a node fails or a new node starts, the given client will be notified of these status changes via its nodeStatusChanges method.
nodeId - the node ID of the nodehost - a host nameclient - a watchdog clientjmxPort - the port JMX is listening on, or -1 if JMX is not
enabled for remote listening on the node
IOException - if a communication problem occurs while
invoking this method
NodeRegistrationFailedException - if there is a problem
registering the node
boolean renewNode(long nodeId)
throws IOException
nodeId is alive. This method returns true if this
watchdog still considers the node alive, and returns false otherwise. This watchdog considers the node to have
failed if a renew request is not received from the node before
the assigned interval, returned from registerNode, expires. If this method returns false
for a given nodeId, the caller should not retry this
method because the node is considered to have failed.
nodeId - a node ID
true if the node is considered alive,
false otherwise
IOException - if a communication problem occurs while
invoking this method
void recoveredNode(long nodeId,
long backupId)
throws IOException
nodeId has been recovered by the node with the specified
backupId.
nodeId - the recovered node's IDbackupId - the backup node's ID
IOException - if a communication problem occurs while
invoking this method
void setNodeHealth(long nodeId,
boolean isLocal,
Node.Health health,
String component,
int maxNumberOfAttempts)
throws IOException
health is RED it indicates that the
node has failed and should be shutdown. In this case, if the given node
is a remote node, this notification is a
result of a server running into difficulty communicating with a remote
node, so the server's watchdog service is responsible for notifying the
watchdog service in order to issue the shutdown. The component
parameter may be any identifying string, but is typically the class
name of the component that reported the specified health.
nodeId - the node's IDisLocal - specifies if the node is reporting health on itself or
a remote nodehealth - the node's healthcomponent - the component reported the specified healthmaxNumberOfAttempts - the maximum number of attempts to try and
resolve an IOException
IOException - if a communication error occurs while trying to set
the node's health
long currentAppTimeMillis()
throws IOException
initialize method
was called on the application's AppListener object.
Note: Since this method is typically called as part of a Remote
interface, appropriate measures should be taken to account for possible
network latency.
IOException - if a communication error occurs while
invoking this method
|
RedDwarf, Version 0.10.1 2010-03-14 10:56:12 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||