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 |
close()
Force closure of write bytes
|
void |
enqueue(Frame frame,
Callback callback) |
void |
failAll(Throwable t) |
void |
failed(Throwable cause)
Callback failure.
|
int |
getBufferSize() |
List<ByteBuffer> |
getByteBuffers()
Get the next set of ByteBuffers to write.
|
boolean |
isClosed()
Used to test for the final frame possible to be enqueued, the CLOSE frame.
|
void |
releasePayloadBuffer(Frame frame) |
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 ByteBuffersflushCallback - 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 close()
public void failAll(Throwable t)
public void failed(Throwable cause)
Conditions: for Endpoint.write() failure.
public int getBufferSize()
public List<ByteBuffer> getByteBuffers()
public boolean isClosed()
public void releasePayloadBuffer(Frame frame)
public void setBufferSize(int bufferSize)
Value usually obtained from AbstractConnection.getInputBufferSize()
bufferSize - the buffer size to usepublic void succeeded()
Copyright © 1995-2013 Mort Bay Consulting. All Rights Reserved.