|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--keepalive.keepalive.KeepAlive | +--keepalive.keepalive.IHearYou
This "Keep-Alive" does not actually do anything for cleaning up the local socket; rather, it helps the remote Are-You-There protocol by waiting for incoming Are-You-Theres and responding to them.
Fields inherited from class keepalive.keepalive.KeepAlive |
ARE_YOU_THERE, endRequested, I_HEAR_YOU, TIME_BETWEEN_ACTIVE_PROBES |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
IHearYou()
|
|
IHearYou(Receiver receiver,
Sender sender)
|
Method Summary | |
boolean |
messageReceived(java.lang.String s)
This method is called by Receiver as the call-back method from MessageListener Ignore all messages but "Are You There." Respond to Are-You-There with "I Hear You." "I Hear you" is expressed here by a dummy message, since its only purpose is to update the last-message-received timestamp for the other side. |
void |
run()
Require the subclasses to implement run(), to prevent them from using the run() method in class Thread with a null body. |
void |
setReceiver(Receiver receiver)
Set the receiver object which receives messages that arrive at the socket associated with this Keep-Alive. |
Methods inherited from class keepalive.keepalive.KeepAlive |
end, endRequested, getDummyString, getReceiver, getSender, getSilentTimeForIncoming, setSender |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, 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 IHearYou(Receiver receiver, Sender sender)
public IHearYou()
Method Detail |
public void setReceiver(Receiver receiver)
setReceiver
in class KeepAlive
receiver
- public void run()
KeepAlive
run
in class KeepAlive
public boolean messageReceived(java.lang.String s)
messageReceived
in interface MessageListener
keepalive.communication.MessageListener
s
- the message that was received
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |