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 java.util.ArrayList<java.nio.ByteBuffer> |
bufferedWrites
Used instead of the deque since it looks equivalent and simpler.
|
protected java.nio.channels.CompletionHandler<java.lang.Integer,java.nio.ByteBuffer> |
completionHandler
The completion handler used for asynchronous write operations
|
protected java.io.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 java.nio.channels.CompletionHandler<java.lang.Long,java.nio.ByteBuffer[]> |
gatherCompletionHandler
The completion handler used for asynchronous write operations
|
protected boolean |
interest
Track write interest
|
protected java.util.concurrent.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 java.nio.channels.CompletionHandler<java.lang.Integer,java.nio.ByteBuffer> completionHandler
protected java.nio.channels.CompletionHandler<java.lang.Long,java.nio.ByteBuffer[]> gatherCompletionHandler
protected java.util.concurrent.Semaphore writePending
protected AbstractEndpoint<Nio2Channel> endpoint
protected java.util.ArrayList<java.nio.ByteBuffer> bufferedWrites
protected java.io.IOException e
public InternalNio2OutputBuffer(Response response, int headerBufferSize)
public void init(SocketWrapper<Nio2Channel> socketWrapper, AbstractEndpoint<Nio2Channel> associatedEndpoint) throws java.io.IOException
init
in class AbstractOutputBuffer<Nio2Channel>
java.io.IOException
public void recycle()
recycle
in class AbstractOutputBuffer<Nio2Channel>
public void nextRequest()
AbstractOutputBuffer
nextRequest
in class AbstractOutputBuffer<Nio2Channel>
public void sendAck() throws java.io.IOException
sendAck
in class AbstractOutputBuffer<Nio2Channel>
java.io.IOException
protected void commit() throws java.io.IOException
commit
in class AbstractOutputBuffer<Nio2Channel>
java.io.IOException
- an underlying I/O error occurredprotected boolean flushBuffer(boolean block) throws java.io.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
.java.io.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-2018 Apache Software Foundation. All Rights Reserved.