public class AckMcastSenderWindow
extends java.lang.Object
Modifier and Type | Class | Description |
---|---|---|
static interface |
AckMcastSenderWindow.RetransmitCommand |
Called by retransmitter thread whenever a message needs to be re-sent
to a destination.
|
Modifier and Type | Field | Description |
---|---|---|
protected static org.apache.commons.logging.Log |
log |
Default retransmit thread suspend timeout (ms)
|
Constructor | Description |
---|---|
AckMcastSenderWindow(AckMcastSenderWindow.RetransmitCommand cmd) |
Create and start the retransmitter
|
AckMcastSenderWindow(AckMcastSenderWindow.RetransmitCommand cmd,
Interval retransmit_intervals) |
Create and start the retransmitter
|
AckMcastSenderWindow(AckMcastSenderWindow.RetransmitCommand cmd,
Interval retransmit_intervals,
TimeScheduler sched) |
Create and start the retransmitter
|
AckMcastSenderWindow(AckMcastSenderWindow.RetransmitCommand cmd,
TimeScheduler sched) |
Create and start the retransmitter
|
Modifier and Type | Method | Description |
---|---|---|
void |
ack(long seqno,
Address sender) |
An ACK has been received from
sender . |
void |
add(long seqno,
Message msg,
java.util.Vector receivers) |
Adds a new message to the hash table.
|
void |
clearStableMessages() |
|
long |
getNumberOfResponsesExpected(long seqno) |
Returns the number of members for a given entry for which acks have to be received
|
long |
getNumberOfResponsesReceived(long seqno) |
Returns the number of members for a given entry for which acks have been received
|
java.util.List |
getStableMessages() |
|
java.lang.String |
printDetails(long seqno) |
Prints all members plus whether an ack has been received from those members for a given seqno
|
void |
remove(Address obj) |
Remove
obj from all receiver sets and wake up
retransmission thread. |
void |
reset() |
Remove all pending msgs from the hashtable.
|
long |
size() |
|
void |
stop() |
Stop the rentransmition and clear all pending msgs.
|
void |
suspect(Address suspected) |
Process with address
suspected is suspected: remove it
from all receiver sets. |
java.lang.String |
toString() |
|
void |
waitUntilAllAcksReceived(long timeout) |
Waits until all outstanding messages have been ACKed by all receivers.
|
protected static final org.apache.commons.logging.Log log
public AckMcastSenderWindow(AckMcastSenderWindow.RetransmitCommand cmd, Interval retransmit_intervals, TimeScheduler sched)
cmd
- the callback object for retranmissionsretransmit_intervals
- the interval between two consecutive
retransmission attemptssched
- the external scheduler to use to schedule retransmissionsjava.lang.IllegalArgumentException
- if cmd
is nullpublic AckMcastSenderWindow(AckMcastSenderWindow.RetransmitCommand cmd, TimeScheduler sched)
cmd
- the callback object for retranmissionssched
- the external scheduler to use to schedule retransmissionsjava.lang.IllegalArgumentException
- if cmd
is nullpublic AckMcastSenderWindow(AckMcastSenderWindow.RetransmitCommand cmd, Interval retransmit_intervals)
cmd
- the callback object for retranmissionsretransmit_intervals
- the interval between two consecutive
retransmission attemptsjava.lang.IllegalArgumentException
- if cmd
is nullpublic AckMcastSenderWindow(AckMcastSenderWindow.RetransmitCommand cmd)
cmd
- the callback object for retranmissionsjava.lang.IllegalArgumentException
- if cmd
is nullpublic void add(long seqno, Message msg, java.util.Vector receivers)
seqno
- The sequence number associated with the messagemsg
- The message (should be a copy!)receivers
- The set of addresses to which the message was sent
and from which consequently an ACK is expectedpublic void ack(long seqno, Address sender)
sender
. Tag the sender in
the hash table as 'received'. If all ACKs have been received, remove
the entry all together.seqno
- The sequence number of the message for which an ACK has
been received.sender
- The sender which sent the ACKpublic void remove(Address obj)
obj
from all receiver sets and wake up
retransmission thread.obj
- the sender to removepublic void suspect(Address suspected)
suspected
is suspected: remove it
from all receiver sets. This means that no ACKs are expected from this
process anymore.suspected
- The suspected processpublic java.util.List getStableMessages()
public void clearStableMessages()
public long size()
public long getNumberOfResponsesExpected(long seqno)
public long getNumberOfResponsesReceived(long seqno)
public java.lang.String printDetails(long seqno)
public void waitUntilAllAcksReceived(long timeout)
timeout
- Miliseconds to wait. 0 means wait indefinitely.public void stop()
public void reset()
public java.lang.String toString()
toString
in class java.lang.Object
Copyright ? 1998-2008 Bela Ban. All Rights Reserved.