|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface defines methods that must be implemented by a buffer. Buffers are used to store messages. It is possible to
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: the different indicators (stored messages, available space, and available messages) have no predetermined semantics: the indicator can be a number of messages, a number of bytes, etc.
Field Summary | |
static String |
ITF_NAME
The commonly used name to refer to this interface. |
Method Summary | |
void |
add(Message message)
Adds the specified message to the buffer. |
int |
availableMessagesIndicator()
Returns an indicator on available messages. |
int |
availableSpaceIndicator()
Returns an indicator on available space. |
Message |
get()
Gets a message from the buffer. |
Message |
remove()
Removes a message from the buffer. |
int |
storedMessagesIndicator()
Returns an indicator on stored messages. |
Field Detail |
public static final String ITF_NAME
Method Detail |
public int storedMessagesIndicator()
public int availableMessagesIndicator()
public int availableSpaceIndicator()
Integer.MAX_VALUE
.
public void add(Message message) throws InterruptedException
Buffers may place limitations on what elements may be added to this buffer. In particular, some buffers require that messages contain particular chunks.
message
- message to be addedto be appended to this list.
InterruptedException
- if it is interrupted while adding the message.public Message remove() throws InterruptedException
availableMessagesIndicator()
returns 0
.
InterruptedException
- if it is interrupted while removing a message.public Message get() throws InterruptedException
availableMessagesIndicator()
returns 0
.
InterruptedException
- if it is interrupted while removing a message.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |