public class WriteBytesProvider extends Object implements Callback
EndPoint.write(Callback, ByteBuffer...)
Callback.Adapter
Constructor and Description |
---|
WriteBytesProvider(Generator generator,
Callback flushCallback)
Create a WriteBytesProvider with specified Generator and "flush" Callback.
|
Modifier and Type | Method and Description |
---|---|
void |
enqueue(Frame frame,
Callback callback) |
void |
failAll(Throwable t) |
void |
failed(Throwable cause)
Write of ByteBuffer failed.
|
int |
getBufferSize() |
ByteBuffer |
getByteBuffer()
Get the next ByteBuffer to write.
|
Throwable |
getFailure() |
boolean |
isClosed()
Used to test for the final frame possible to be enqueued, the CLOSE frame.
|
boolean |
isFailed() |
void |
setBufferSize(int bufferSize)
Set the buffer size used for generating ByteBuffers from the frames.
|
void |
succeeded()
Write of ByteBuffer succeeded.
|
String |
toString() |
public WriteBytesProvider(Generator generator, Callback flushCallback)
generator
- the generator to use for converting Frame
objects to network ByteBuffer
sflushCallback
- the flush callback to call, on a write event, after the write event has been processed by this WriteBytesProvider
.
Used to trigger another flush of the next set of bytes.
public void failAll(Throwable t)
public void failed(Throwable cause)
public int getBufferSize()
public ByteBuffer getByteBuffer()
public Throwable getFailure()
public boolean isClosed()
public boolean isFailed()
public void setBufferSize(int bufferSize)
Value usually obtained from AbstractConnection.getInputBufferSize()
bufferSize
- the buffer size to usepublic void succeeded()
succeeded
in interface Callback
Callback.failed(Throwable)
Copyright © 1995-2012 Mort Bay Consulting. All Rights Reserved.