|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.openorb.io.BufferSource
A StorageBuffer list. As fragments arrive their buffers are appended to
the list. Consumers of the buffer source repeditivly call 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.
Inner Class Summary | |
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 Summary | |
BufferSource()
Default constructor. |
|
BufferSource(StorageBuffer buffer,
boolean isLast)
Constructor. |
Method Summary | |
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. |
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(SystemException exception)
Set exceptional result. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BufferSource()
public BufferSource(StorageBuffer buffer, boolean isLast)
buffer
- The first buffer fragment.isLast
- Indicates whether the first parameter is already the last fragment.Method Detail |
public int available()
public StorageBuffer next()
public void mark()
public StorageBuffer reset()
public void setException(SystemException exception)
public SystemException getException()
public void addLast(StorageBuffer buffer, boolean isLast)
public void addWaitingForBufferListener(BufferSource.WaitingForBufferListener listener) throws java.util.TooManyListenersException
listener
- The listener to register.public 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.public void removeLastMessageProcessedListener(BufferSource.LastMessageProcessedListener listener)
listener
- The listener to remove.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |