public class BufferSource
extends java.lang.Object
next()
to read storage buffers, when the last buffer is received next() will
return null. To terminate reading early call setException(org.omg.CORBA.SystemException) followed
by next() to notify any listeners of the final read.| Modifier and Type | Class and Description |
|---|---|
static interface |
BufferSource.LastMessageProcessedListener
Called when the last message has been processed or an exception is to be
returned from
next(). |
static interface |
BufferSource.WaitingForBufferListener
Called whenever a buffer is needed to continue processing.
|
| Constructor and Description |
|---|
BufferSource()
Default constructor.
|
BufferSource(StorageBuffer buffer,
boolean isLast)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addLast(StorageBuffer buffer,
boolean isLast)
Add buffer to end of chain.
|
void |
addLastMessageProcessedListener(BufferSource.LastMessageProcessedListener listener)
Registers LastMessageProcessedListener to receive events.
|
void |
addWaitingForBufferListener(BufferSource.WaitingForBufferListener listener)
Registers WaitingForBufferListener to receive events.
|
int |
available()
Total size of remaining fragments.
|
org.omg.CORBA.SystemException |
getException()
Get exception set with setException.
|
void |
mark()
Mark buffer sequence.
|
StorageBuffer |
next()
Gets next buffer in message.
|
void |
removeLastMessageProcessedListener(BufferSource.LastMessageProcessedListener listener)
Removes LastMessageProcessedListener from the list of listeners.
|
void |
removeWaitingForBufferListener(BufferSource.WaitingForBufferListener listener)
Removes WaitingForBufferListener from the list of listeners.
|
StorageBuffer |
reset()
Reset to previously marked position
|
void |
setException(org.omg.CORBA.SystemException exception)
Set exceptional result.
|
public BufferSource()
public BufferSource(StorageBuffer buffer, boolean isLast)
buffer - The first buffer fragment.isLast - Indicates whether the first parameter is already the last fragment.public int available()
public StorageBuffer next()
public void mark()
public StorageBuffer reset()
public void setException(org.omg.CORBA.SystemException exception)
public org.omg.CORBA.SystemException getException()
public void addLast(StorageBuffer buffer, boolean isLast)
public void addWaitingForBufferListener(BufferSource.WaitingForBufferListener listener) throws java.util.TooManyListenersException
listener - The listener to register.java.util.TooManyListenersExceptionpublic void removeWaitingForBufferListener(BufferSource.WaitingForBufferListener listener)
listener - The listener to remove.public void addLastMessageProcessedListener(BufferSource.LastMessageProcessedListener listener) throws java.util.TooManyListenersException
listener - The listener to register.java.util.TooManyListenersExceptionpublic void removeLastMessageProcessedListener(BufferSource.LastMessageProcessedListener listener)
listener - The listener to remove.