akka.remote
Class AckedReceiveBuffer<T extends HasSequenceNumber>

java.lang.Object
  extended by akka.remote.AckedReceiveBuffer<T>
All Implemented Interfaces:
java.io.Serializable, scala.Equals, scala.Product

public class AckedReceiveBuffer<T extends HasSequenceNumber>
extends java.lang.Object
implements scala.Product, scala.Serializable

Implements an immutable receive buffer that buffers incoming messages until they can be safely delivered. This buffer works together with a AckedSendBuffer on the sender() side.

See Also:
Serialized Form

Constructor Summary
AckedReceiveBuffer(SeqNo lastDelivered, SeqNo cumulativeAck, scala.collection.immutable.SortedSet<T> buf, scala.math.Ordering<T> seqOrdering)
           
 
Method Summary
 scala.collection.immutable.SortedSet<T> buf()
           
 SeqNo cumulativeAck()
           
 scala.Tuple3<AckedReceiveBuffer<T>,scala.collection.immutable.Seq<T>,Ack> extractDeliverable()
          Extract all messages that could be safely delivered, an updated ack to be sent to the sender(), and an updated buffer that has the messages removed that can be delivered.
 SeqNo lastDelivered()
           
 AckedReceiveBuffer<T> mergeFrom(AckedReceiveBuffer<T> that)
          Merges two receive buffers.
 AckedReceiveBuffer<T> receive(T arrivedMsg)
          Puts a sequenced message in the receive buffer returning a new buffer.
 scala.math.Ordering<T> seqOrdering()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface scala.Product
productArity, productElement, productIterator, productPrefix
 
Methods inherited from interface scala.Equals
canEqual, equals
 

Constructor Detail

AckedReceiveBuffer

public AckedReceiveBuffer(SeqNo lastDelivered,
                          SeqNo cumulativeAck,
                          scala.collection.immutable.SortedSet<T> buf,
                          scala.math.Ordering<T> seqOrdering)
Method Detail

lastDelivered

public SeqNo lastDelivered()

cumulativeAck

public SeqNo cumulativeAck()

buf

public scala.collection.immutable.SortedSet<T> buf()

seqOrdering

public scala.math.Ordering<T> seqOrdering()

receive

public AckedReceiveBuffer<T> receive(T arrivedMsg)
Puts a sequenced message in the receive buffer returning a new buffer.

Parameters:
arrivedMsg - message to be put into the buffer.
Returns:
The updated buffer containing the message.

extractDeliverable

public scala.Tuple3<AckedReceiveBuffer<T>,scala.collection.immutable.Seq<T>,Ack> extractDeliverable()
Extract all messages that could be safely delivered, an updated ack to be sent to the sender(), and an updated buffer that has the messages removed that can be delivered.

Returns:
Triplet of the updated buffer, messages that can be delivered and the updated acknowledgement.

mergeFrom

public AckedReceiveBuffer<T> mergeFrom(AckedReceiveBuffer<T> that)
Merges two receive buffers. Merging preserves sequencing of messages, and drops all messages that has been safely acknowledged by any of the participating buffers. Also updates the expected sequence numbers.

Parameters:
that - The receive buffer to merge with
Returns:
The merged receive buffer.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object