public class InternalNio2OutputBuffer extends AbstractOutputBuffer<Nio2Channel>
Modifier and Type | Class and Description |
---|---|
protected class |
InternalNio2OutputBuffer.SocketOutputBuffer
This class is an output buffer which will write data to an output
stream.
|
Modifier and Type | Field and Description |
---|---|
protected ArrayList<ByteBuffer> |
bufferedWrites
Used instead of the deque since it looks equivalent and simpler.
|
protected CompletionHandler<Integer,ByteBuffer> |
completionHandler
The completion handler used for asynchronous write operations
|
protected IOException |
e
Exception that occurred during writing.
|
protected AbstractEndpoint<Nio2Channel> |
endpoint
The associated endpoint.
|
protected boolean |
flipped
Track if the byte buffer is flipped
|
protected CompletionHandler<Long,ByteBuffer[]> |
gatherCompletionHandler
The completion handler used for asynchronous write operations
|
protected boolean |
interest
Track write interest
|
protected Semaphore |
writePending
Write pending flag.
|
activeFilters, bufferedWriteSize, byteCount, committed, filterLibrary, finished, headerBuffer, lastActiveFilter, outputStreamOutputBuffer, pos, response, sm, socketBuffer
Constructor and Description |
---|
InternalNio2OutputBuffer(Response response,
int headerBufferSize)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
commit()
Commit the response.
|
protected boolean |
flushBuffer(boolean block)
Callback to write data from the buffer.
|
protected boolean |
hasBufferedData() |
boolean |
hasDataToWrite() |
protected boolean |
hasMoreDataToFlush() |
void |
init(SocketWrapper<Nio2Channel> socketWrapper,
AbstractEndpoint<Nio2Channel> associatedEndpoint) |
void |
nextRequest()
End processing of current HTTP request.
|
void |
recycle()
Recycle the output buffer.
|
void |
registerWriteInterest() |
void |
sendAck()
Send an acknowledgment.
|
addActiveFilter, addFilter, doWrite, endHeaders, endRequest, flush, getBufferedWriteSize, getBytesWritten, getFilters, getSocketBuffer, isBlocking, isReady, reset, sendHeader, sendStatus, setBufferedWriteSize, setSocketBuffer, write, write, write, write, write
protected volatile boolean interest
protected volatile boolean flipped
protected CompletionHandler<Integer,ByteBuffer> completionHandler
protected CompletionHandler<Long,ByteBuffer[]> gatherCompletionHandler
protected Semaphore writePending
protected AbstractEndpoint<Nio2Channel> endpoint
protected ArrayList<ByteBuffer> bufferedWrites
protected IOException e
public InternalNio2OutputBuffer(Response response, int headerBufferSize)
public void init(SocketWrapper<Nio2Channel> socketWrapper, AbstractEndpoint<Nio2Channel> associatedEndpoint) throws IOException
init
in class AbstractOutputBuffer<Nio2Channel>
IOException
public void recycle()
recycle
in class AbstractOutputBuffer<Nio2Channel>
public void nextRequest()
AbstractOutputBuffer
nextRequest
in class AbstractOutputBuffer<Nio2Channel>
public void sendAck() throws IOException
sendAck
in class AbstractOutputBuffer<Nio2Channel>
IOException
protected void commit() throws IOException
commit
in class AbstractOutputBuffer<Nio2Channel>
IOException
- an underlying I/O error occurredprotected boolean flushBuffer(boolean block) throws IOException
flushBuffer
in class AbstractOutputBuffer<Nio2Channel>
block
- Should this method block until the buffer is emptytrue
if data remains in the buffer (which can only
happen in non-blocking mode) else false
.IOException
public boolean hasDataToWrite()
hasDataToWrite
in class AbstractOutputBuffer<Nio2Channel>
protected boolean hasMoreDataToFlush()
hasMoreDataToFlush
in class AbstractOutputBuffer<Nio2Channel>
protected boolean hasBufferedData()
hasBufferedData
in class AbstractOutputBuffer<Nio2Channel>
public void registerWriteInterest()
registerWriteInterest
in class AbstractOutputBuffer<Nio2Channel>
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.