Package org.jgroups.protocols.tom
Class SequenceNumberManager
- java.lang.Object
-
- org.jgroups.protocols.tom.SequenceNumberManager
-
public class SequenceNumberManager extends java.lang.Object
Manages the messages sequence number (keeps it up-to-date)- Since:
- 3.1
- Author:
- Pedro Ruivo
-
-
Constructor Summary
Constructors Constructor Description SequenceNumberManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
get()
long
getAndIncrement()
void
update(long otherSequenceNumber)
updates the sequence number to the maximum between themlong
updateAndGet(long otherSequenceNumber)
updates the sequence number and returns the next, that will be used a propose sequence number
-
-
-
Method Detail
-
getAndIncrement
public long getAndIncrement()
- Returns:
- the next sequence number
-
update
public void update(long otherSequenceNumber)
updates the sequence number to the maximum between them- Parameters:
otherSequenceNumber
- the sequence number received
-
updateAndGet
public long updateAndGet(long otherSequenceNumber)
updates the sequence number and returns the next, that will be used a propose sequence number- Parameters:
otherSequenceNumber
- the sequence number received- Returns:
- the next sequence number or the received sequence number, if the received sequence number is higher the the actual sequence number
-
get
public long get()
-
-