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.
-
SlidingWindow()
-
-
SlidingWindow(Object, SlidingWindow. RetransmitCommand)
-
-
Add(long, Message)
- Adds a message according to its sequence number (ordered).
-
finalize()
-
-
main(String[])
-
-
Remove()
-
Removes an entry if its sequence number if 1 higher than
next_to_remove.
-
Reset()
- Deletes all entries
-
run()
- Check for each message whether it needs to be retransmitted (by checking age of
msg).
-
Start()
-
-
Stop()
-
-
toString()
-
SlidingWindow
public SlidingWindow()
SlidingWindow
public SlidingWindow(Object sender,
SlidingWindow. RetransmitCommand command)
finalize
public void finalize()
- Overrides:
- finalize in class Object
Start
public void Start()
Stop
public void Stop()
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.
Remove
public Message Remove()
- Removes an entry if its sequence number if 1 higher than
next_to_remove.
Returns null otherwise
Reset
public void Reset()
- Deletes all entries
toString
public String toString()
- Overrides:
- toString in class Object
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).
main
public static void main(String args[])
All Packages Class Hierarchy This Package Previous Next Index