org.jgroups.protocols.tom
Class SequenceNumberManager

java.lang.Object
  extended by 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
SequenceNumberManager()
           
 
Method Summary
 long getAndIncrement()
           
 void update(long otherSequenceNumber)
          updates the sequence number to the maximum between them
 long updateAndGet(long otherSequenceNumber)
          updates the sequence number and returns the next, that will be used a propose sequence number
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SequenceNumberManager

public SequenceNumberManager()
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


Copyright © 1998-2012 Bela Ban / Red Hat. All Rights Reserved.