|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.Thread
cgl.narada.transport.udp.UDPPingHandler
public class UDPPingHandler
Title: UDPPingHandler
Description: This class sends a ping message to figure out a node is up or down.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
Thread.State, Thread.UncaughtExceptionHandler |
| Field Summary |
|---|
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
UDPPingHandler()
|
|
UDPPingHandler(UDPLinkFactory udpLinkFactory)
|
|
| Method Summary | |
|---|---|
void |
ackReceived(String linkname,
long pingtime)
does the required tasks when an acknowledge received for a ping message |
void |
addLinkForMonitoring(UDPLink link)
|
void |
calculateNewRTT(cgl.narada.transport.udp.UDPPingHandler.PingObject pingobject,
long rtt)
calculetes the RTT value between two nodes. |
int |
getMaxPingFailNumber()
|
long |
getPingInterval()
|
void |
handlePing()
sends ping in a given interval if acknowledge to a ping received, does required task to handle acknowledge |
static void |
main(String[] args)
|
void |
pingMessage(byte[] pmessage,
byte[] time)
creates ping message. |
void |
removePing(String linkname)
removes a ping object from hashtable so that the ping for that not is not required any more. |
void |
run()
runs thread |
void |
sendPing(UDPLink link,
long _pingtime)
sends a ping message to a given node |
void |
setDebug(boolean debug)
sets a debug value for this class |
void |
setMaxPingFailNumber(int number)
sets the veriable to value to limit the allowable number of sequential ping fail |
void |
setPingInterval(long time)
sets the value of interval between two pings. |
void |
shutdownServices()
|
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public UDPPingHandler()
public UDPPingHandler(UDPLinkFactory udpLinkFactory)
| Method Detail |
|---|
public void shutdownServices()
public void addLinkForMonitoring(UDPLink link)
public void setMaxPingFailNumber(int number)
number - maximum allowable numberpublic int getMaxPingFailNumber()
public void setDebug(boolean debug)
debug - public void setPingInterval(long time)
time - is an interval valuespublic long getPingInterval()
public void calculateNewRTT(cgl.narada.transport.udp.UDPPingHandler.PingObject pingobject,
long rtt)
pingobject - keeps whole data about a pingrtt - RTT value for between two nodes.
public void pingMessage(byte[] pmessage,
byte[] time)
pmessage - byte array of ping messagetime - sending time. it is used both calculation for rtt and
seperation between ping messagespublic void removePing(String linkname)
linkname - the name of link for a node
public void ackReceived(String linkname,
long pingtime)
linkname - the name of link whose acknowledge is receivedpingtime - the time of ping whose acknowledge is received
public void sendPing(UDPLink link,
long _pingtime)
throws Exception
link - consists information a node to send a ping_pingtime - ping time for the ping
Exception
public void handlePing()
throws Exception
Exceptionpublic void run()
run in interface Runnablerun in class Threadpublic static void main(String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||