org.objectweb.dream.queue
Interface BufferRemove

All Known Implementing Classes:
AbstractBufferImpl, BufferAscendingSequenceNumberImpl, BufferFIFOImpl, BufferKeyMutexSortedImpl, BufferLIFOImpl, BufferMatchingImpl, BufferSortingImpl

public interface BufferRemove

This interface defines methods that must be implemented by a buffer to allow components to get or delete messages from it. Such an interface is used by consumers of messages.

Note 1: all the messages that are stored in a buffer are not always available for removal (e.g. when the buffer implements an ordering policy).

Note 2: buffer implementations MUST BE thread-safe .


Field Summary
static String ITF_NAME
          The commonly used name to refer to an interface with this signature.
 
Method Summary
 Message get()
          Gets a message from the buffer.
 Message remove()
          Removes a message from the buffer.
 Message removeAll()
          Removes all the available messages from the buffer.
 Message tryGet()
          Gets a message from the buffer.
 Message tryRemove()
          Removes a message from the buffer.
 

Field Detail

ITF_NAME

static final String ITF_NAME
The commonly used name to refer to an interface with this signature.

See Also:
Constant Field Values
Method Detail

get

Message get()
            throws InterruptedException
Gets a message from the buffer. This method blocks if no message is available.

Returns:
a message; never null.
Throws:
InterruptedException - if it is interrupted while waiting for a message to be added.

tryGet

Message tryGet()
Gets a message from the buffer. This method does not block.

Returns:
a message if there is one available, null otherwise.

remove

Message remove()
               throws InterruptedException
Removes a message from the buffer. This method blocks if no message is available.

Returns:
the removed message; never null.
Throws:
InterruptedException - if it is interrupted while waiting for a message to be added.

tryRemove

Message tryRemove()
Removes a message from the buffer. This method does not block.

Returns:
a message if there is one available, null otherwise.

removeAll

Message removeAll()
Removes all the available messages from the buffer. Messages are returned in an aggregated message. If no message has been removed, this method returns null. This method does not block.

Returns:
an aggregated message containing all the messages available from the buffer, or null if no message was available.


Copyright © 2003, 2005 - INRIA Rhone-Alpes - All Rights Reserved.