org.jgroups.protocols.tom
Class DeliveryManagerImpl

java.lang.Object
  extended by org.jgroups.protocols.tom.DeliveryManagerImpl
All Implemented Interfaces:
DeliveryManager

public class DeliveryManagerImpl
extends java.lang.Object
implements DeliveryManager

The implementation of the Delivery Manager

Since:
3.1
Author:
Pedro Ruivo

Constructor Summary
DeliveryManagerImpl()
           
 
Method Summary
 void addNewMessageToDeliver(MessageID messageID, Message message, long sequenceNumber)
          Add a new group message to be deliver
 void clear()
          remove all the pending messages
 void deliverSingleDestinationMessage(Message msg)
          delivers a message that has only as destination member this node
 java.util.Set<org.jgroups.protocols.tom.DeliveryManagerImpl.MessageInfo> getMessageSet()
          It is used for testing (see the messages in JMX)
 java.util.List<Message> getNextMessagesToDeliver()
          returns an ordered list with the messages to be deliver.
 void markReadyToDeliver(MessageID messageID, long finalSequenceNumber)
          marks the message as ready to deliver and set the final sequence number (to be ordered)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeliveryManagerImpl

public DeliveryManagerImpl()
Method Detail

addNewMessageToDeliver

public void addNewMessageToDeliver(MessageID messageID,
                                   Message message,
                                   long sequenceNumber)
Add a new group message to be deliver

Parameters:
messageID - the message ID
message - the message (needed to be deliver later)
sequenceNumber - the initial sequence number

markReadyToDeliver

public void markReadyToDeliver(MessageID messageID,
                               long finalSequenceNumber)
marks the message as ready to deliver and set the final sequence number (to be ordered)

Parameters:
messageID - the message ID
finalSequenceNumber - the final sequence number

getNextMessagesToDeliver

public java.util.List<Message> getNextMessagesToDeliver()
                                                 throws java.lang.InterruptedException
Description copied from interface: DeliveryManager
returns an ordered list with the messages to be deliver. This method blocks if no messages are ready to be deliver

Specified by:
getNextMessagesToDeliver in interface DeliveryManager
Returns:
a list of messages to deliver
Throws:
java.lang.InterruptedException - if it is interrupted

clear

public void clear()
remove all the pending messages


deliverSingleDestinationMessage

public void deliverSingleDestinationMessage(Message msg)
delivers a message that has only as destination member this node

Parameters:
msg - the message

getMessageSet

public java.util.Set<org.jgroups.protocols.tom.DeliveryManagerImpl.MessageInfo> getMessageSet()
It is used for testing (see the messages in JMX)

Returns:
unmodifiable set of messages


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