All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class JavaGroups.AckReceiverWindow

java.lang.Object
   |
   +----JavaGroups.AckReceiverWindow

public class AckReceiverWindow
extends Object
Maintains a window of window_size size (should currently be the same as in the AckSenderWindow counterpart (we don't yet have dynamically adjusting window sizes). Any message is added in order, duplicate messages are discarded. Every message received is ACK'ed (even duplicates). When the window is full, only a message that would remove a message from the window is accepted (that is, one whose seq_no is equal to the next_to_remove), all others are discarded.

Messages are removed in order; the first message has to have its seq_no equal to next_to_remove (which will be incremented when a message is removed).


Constructor Index

 o AckReceiverWindow(int, long)
 o AckReceiverWindow(long)

Method Index

 o Add(long, Message)
 o main(String[])
 o Remove()
Removes a message whose seq_no is equal to next_to_remove, increments the latter.
 o toString()

Constructors

 o AckReceiverWindow
 public AckReceiverWindow(long initial_seq_no)
 o AckReceiverWindow
 public AckReceiverWindow(int window_size,
                          long initial_seq_no)

Methods

 o Add
 public void Add(long seq_no,
                 Message msg)
 o Remove
 public Message Remove()
Removes a message whose seq_no is equal to next_to_remove, increments the latter. Returns message that was removed, or null, if no message can be removed. Messages are thus removed in order.

 o toString
 public String toString()
Overrides:
toString in class Object
 o main
 public static void main(String args[])

All Packages  Class Hierarchy  This Package  Previous  Next  Index