org.objectweb.dream.queue
Interface BufferAdd

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

public interface BufferAdd

This interface defines methods that must be implemented by a buffer to allow components to add messages into it. Such an interface is used by producers of messages.

Note: 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
 void add(Message message)
          Adds the specified message to the buffer.
 boolean tryAdd(Message message)
          Adds the specified message to 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

add

void add(Message message)
         throws InterruptedException
Adds the specified message to the buffer. This method blocks if there is not enough space available.

Buffers may place limitations on what elements may be added to this buffer. In particular, some buffers require that messages contain particular chunks.

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

tryAdd

boolean tryAdd(Message message)
Adds the specified message to the buffer. If the message cannot be added (due to space limitation), the message is not added.

Buffers may place limitations on what elements may be added to this buffer. In particular, some buffers require that messages contain particular chunks.

Parameters:
message - the message to be added; never null.
Returns:
true if the message has been added.


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