All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class JavaGroups.SlidingWindow

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

public class SlidingWindow
extends Object
implements Runnable
Keeps track of messages according to their sequence numbers. Allows messages to be added out of order, and with gaps between sequence numbers. Method Remove removes the first message with a sequence number that is 1 higher than next_to_remove (this variable is then incremented), or it returns null if no message is present, or if no message's sequence number is 1 higher.


Constructor Index

 o SlidingWindow()
 o SlidingWindow(Object, SlidingWindow. RetransmitCommand)

Method Index

 o Add(long, Message)
Adds a message according to its sequence number (ordered).
 o finalize()
 o main(String[])
 o Remove()
Removes an entry if its sequence number if 1 higher than next_to_remove.
 o Reset()
Deletes all entries
 o run()
Check for each message whether it needs to be retransmitted (by checking age of msg).
 o Start()
 o Stop()
 o toString()

Constructors

 o SlidingWindow
 public SlidingWindow()
 o SlidingWindow
 public SlidingWindow(Object sender,
                      SlidingWindow. RetransmitCommand command)

Methods

 o finalize
 public void finalize()
Overrides:
finalize in class Object
 o Start
 public void Start()
 o Stop
 public void Stop()
 o Add
 public void Add(long seq_no,
                 Message msg)
Adds a message according to its sequence number (ordered). Fill gaps with entries which have 'null' messages.

 o Remove
 public Message Remove()
Removes an entry if its sequence number if 1 higher than next_to_remove. Returns null otherwise

 o Reset
 public void Reset()
Deletes all entries

 o toString
 public String toString()
Overrides:
toString in class Object
 o run
 public void run()
Check for each message whether it needs to be retransmitted (by checking age of msg). If this is the case, call retransmit_command with the corresponding parameters (pt2pt, mcast or suspect). While iterating through msgs, compute the min. wait time for all messages. At the end of an iteration, sleep for that period of time. This gives the chance to add / remove messages (otherwise this would be blocked).

 o main
 public static void main(String args[])

All Packages  Class Hierarchy  This Package  Previous  Next  Index