|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.restlet.util.ReadingListener
public abstract class ReadingListener
Selection listener notifying new content is read into a ByteBuffer
.
Constructor Summary | |
---|---|
ReadingListener(ReadableByteChannel byteChannel,
ByteBuffer byteBuffer)
Constructor. |
|
ReadingListener(ReadableByteChannel byteChannel,
int bufferSize)
Constructor. |
|
ReadingListener(Representation source)
Default constructor. |
|
ReadingListener(Representation source,
int bufferSize)
Constructor. |
Method Summary | |
---|---|
protected abstract void |
onContent(ByteBuffer byteBuffer)
Callback invoked when new content is available. |
protected void |
onEnd()
Callback invoked when the end of the representation has been reached. |
protected void |
onError(IOException ioe)
Callback invoked when an IO exception occurs. |
void |
onSelected(SelectionRegistration selectionRegistration)
Callback invoked when new content is available. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ReadingListener(ReadableByteChannel byteChannel, ByteBuffer byteBuffer) throws IOException
byteChannel
- The source byte channel.byteBuffer
- The byte buffer to use.
IOException
public ReadingListener(ReadableByteChannel byteChannel, int bufferSize) throws IOException
byteChannel
- The source byte channel.bufferSize
- The size of the byte buffer to use.
IOException
public ReadingListener(Representation source) throws IOException
IoUtils.BUFFER_SIZE
length.
source
- The source representation.
IOException
public ReadingListener(Representation source, int bufferSize) throws IOException
source
- The source byte channel.bufferSize
- The size of the byte buffer to use.
IOException
Method Detail |
---|
protected abstract void onContent(ByteBuffer byteBuffer)
byteBuffer
- The byte buffer filled with the new content (correctly flip).protected void onEnd()
protected void onError(IOException ioe)
Level.WARNING
level.
ioe
- The exception caught.public final void onSelected(SelectionRegistration selectionRegistration) throws IOException
onContent(ByteBuffer)
method or the onEnd()
method or
the onError(IOException)
method.
onSelected
in interface SelectionListener
selectionRegistration
- The selected registration.
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |