|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.tribe.faultdetection.PingManagerThread
This class defines a PingManagerThread. A ping thread will periodically send ping to addresses and send events to registered listeners.
Constructor Summary | |
PingManagerThread(IpAddress localAddress,
long waitInterval)
Creates a new PingManagerThread object |
Method Summary | |
void |
addListener(FaultDetectionListener listener)
Register a new ping listener, that will receive ping events |
void |
addPingHook(Address address)
Tell the thread it shoudl start pinging a new address |
void |
getResult(IpAddress address)
Get the result and call back events on listeners |
long |
getWaitInterval()
Returns the waitInterval value. |
void |
notifyListenerOfEvent(int event,
IpAddress address)
Notify listeners of an event on the specified address |
void |
removeListener(FaultDetectionListener listener)
Unregister a ping listener |
void |
removePingHook(Address address)
Tell the thread to stop pinging an address |
void |
run()
|
void |
setStop(boolean stop)
Tell the thread to stop as soon as possible |
void |
setWaitInterval(long waitInterval)
Sets the waitInterval value. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PingManagerThread(IpAddress localAddress, long waitInterval)
PingManagerThread
object
localAddress
- waitInterval
- the time between two pingMethod Detail |
public void setStop(boolean stop)
stop
- The stop to set.public long getWaitInterval()
public void setWaitInterval(long waitInterval)
waitInterval
- The waitInterval to set.public void addPingHook(Address address)
address
- Address
to pingpublic void removePingHook(Address address)
address
- Address
to stop pingingpublic void addListener(FaultDetectionListener listener)
listener
- FaultDetectionListener
object that will then
receive events and results of ping actionpublic void removeListener(FaultDetectionListener listener)
listener
- FaultDetectionListener
will not receive
further eventspublic void getResult(IpAddress address)
address
- IpAddress
of the result to getpublic void notifyListenerOfEvent(int event, IpAddress address)
event
- an int representing the event valueaddress
- the address where the event occuredFaultDetectionService
public void run()
run
in interface java.lang.Runnable
Runnable.run()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |