| java.lang.Object org.jgroups.stack.Retransmitter
All known Subclasses: org.jgroups.stack.AckSenderWindow, org.jgroups.tests.NakReceiverWindowStressTest, org.jgroups.protocols.pbcast.NAKACK,
Retransmitter | public class Retransmitter (Code) | | Maintains a pool of sequence numbers of messages that need to be retransmitted. Messages
are aged and retransmission requests sent according to age (linear backoff used). If a
TimeScheduler instance is given to the constructor, it will be used, otherwise Reransmitter
will create its own. The retransmit timeouts have to be set first thing after creating an instance.
The add() method adds a range of sequence numbers of messages to be retransmitted. The
remove() method removes a sequence number again, cancelling retransmission requests for it.
Whenever a message needs to be retransmitted, the RetransmitCommand.retransmit() method is called.
It can be used e.g. by an ack-based scheme (e.g. AckSenderWindow) to retransmit a message to the receiver, or
by a nak-based scheme to send a retransmission request to the sender of the missing message.
author: John Giorgiadis author: Bela Ban version: $Revision: 1.10.10.3 $ |
Inner Class :public interface RetransmitCommand | |
Field Summary | |
final protected static Log | log |
Method Summary | |
public void | add(long first_seqno, long last_seqno) Add the given range [first_seqno, last_seqno] in the list of
entries eligible for retransmission. | public static void | main(String[] args) | public void | remove(long seqno) Remove the given sequence number from the list of seqnos eligible
for retransmission. | public void | reset() | public void | setRetransmitTimeouts(long[] timeouts) | public int | size() | static void | sleep(long timeout) | public void | stop() Stop the rentransmition and clear all pending msgs.
If this retransmitter has been provided an externally managed
scheduler, then just clear all msgs and the associated tasks, else
stop the scheduler. | public String | toString() |
log | final protected static Log log(Code) | | |
Retransmitter | public Retransmitter(Address sender, RetransmitCommand cmd, TimeScheduler sched)(Code) | | Create a new Retransmitter associated with the given sender address
Parameters: sender - the address from which retransmissions are expected or to which retransmissions are sent Parameters: cmd - the retransmission callback reference Parameters: sched - retransmissions scheduler |
Retransmitter | public Retransmitter(Address sender, RetransmitCommand cmd)(Code) | | Create a new Retransmitter associated with the given sender address
Parameters: sender - the address from which retransmissions are expected or to which retransmissions are sent Parameters: cmd - the retransmission callback reference |
add | public void add(long first_seqno, long last_seqno)(Code) | | Add the given range [first_seqno, last_seqno] in the list of
entries eligible for retransmission. If first_seqno > last_seqno,
then the range [last_seqno, first_seqno] is added instead
If retransmitter thread is suspended, wake it up
|
remove | public void remove(long seqno)(Code) | | Remove the given sequence number from the list of seqnos eligible
for retransmission. If there are no more seqno intervals in the
respective entry, cancel the entry from the retransmission
scheduler and remove it from the pending entries
|
reset | public void reset()(Code) | | Reset the retransmitter: clear all msgs and cancel all the
respective tasks
|
setRetransmitTimeouts | public void setRetransmitTimeouts(long[] timeouts)(Code) | | |
sleep | static void sleep(long timeout)(Code) | | |
stop | public void stop()(Code) | | Stop the rentransmition and clear all pending msgs.
If this retransmitter has been provided an externally managed
scheduler, then just clear all msgs and the associated tasks, else
stop the scheduler. In this case the method blocks until the
scheduler's thread is dead. Only the owner of the scheduler should
stop it.
|
|
|