public class AckReceiverWindow extends Object
next_to_remove
. When a message with
a seqno less than next_to_remove is received, it will be discarded. The remove()
method removes
and returns a message whose seqno is equal to next_to_remove, or null if not found.Constructor and Description |
---|
AckReceiverWindow(long initial_seqno) |
AckReceiverWindow(long initial_seqno,
int segment_capacity) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(long seqno,
Message msg)
Adds a new message.
|
byte |
add2(long seqno,
Message msg)
Adds a message if not yet received
|
AtomicBoolean |
getProcessing() |
String |
printMessages() |
Message |
remove()
Removes a message whose seqno is equal to
next_to_remove , increments the latter. |
Tuple<List<Message>,Long> |
removeMany(int max)
Removes as many messages as possible (in sequence, without gaps)
|
List<Message> |
removeManyAsList(int max) |
void |
reset() |
int |
size() |
String |
toString() |
public static final Message TOMBSTONE
public AckReceiverWindow(long initial_seqno)
public AckReceiverWindow(long initial_seqno, int segment_capacity)
public AtomicBoolean getProcessing()
public boolean add(long seqno, Message msg)
public byte add2(long seqno, Message msg)
seqno
- msg
- public Message remove()
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.public Tuple<List<Message>,Long> removeMany(int max)
max
- Max number of messages to be removedpublic void reset()
public int size()
public String printMessages()
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.