private class BufferedResponseHandler.BufferedInterceptor extends java.lang.Object implements HttpOutput.Interceptor
Modifier and Type | Field and Description |
---|---|
(package private) java.nio.ByteBuffer |
_aggregate |
(package private) java.lang.Boolean |
_aggregating |
(package private) java.util.Queue<java.nio.ByteBuffer> |
_buffers |
(package private) HttpChannel |
_channel |
(package private) HttpOutput.Interceptor |
_next |
Constructor and Description |
---|
BufferedInterceptor(HttpChannel httpChannel,
HttpOutput.Interceptor interceptor) |
Modifier and Type | Method and Description |
---|---|
protected void |
commit(java.util.Queue<java.nio.ByteBuffer> buffers,
Callback callback) |
HttpOutput.Interceptor |
getNextInterceptor() |
boolean |
isOptimizedForDirectBuffers() |
void |
resetBuffer()
Reset the buffers.
|
void |
write(java.nio.ByteBuffer content,
boolean last,
Callback callback)
Write content.
|
final HttpOutput.Interceptor _next
final HttpChannel _channel
final java.util.Queue<java.nio.ByteBuffer> _buffers
java.lang.Boolean _aggregating
java.nio.ByteBuffer _aggregate
public BufferedInterceptor(HttpChannel httpChannel, HttpOutput.Interceptor interceptor)
public void resetBuffer()
HttpOutput.Interceptor
If the Interceptor contains buffers then reset them.
resetBuffer
in interface HttpOutput.Interceptor
public void write(java.nio.ByteBuffer content, boolean last, Callback callback)
HttpOutput.Interceptor
write
in interface HttpOutput.Interceptor
content
- The content to be written or an empty buffer.last
- True if this is the last call to writecallback
- The callback to use to indicate Callback.succeeded()
or Callback.failed(Throwable)
.public HttpOutput.Interceptor getNextInterceptor()
getNextInterceptor
in interface HttpOutput.Interceptor
public boolean isOptimizedForDirectBuffers()
isOptimizedForDirectBuffers
in interface HttpOutput.Interceptor
ByteBuffer
s in the HttpOutput.Interceptor.write(ByteBuffer, boolean, Callback)
method. If false is returned, then passing direct buffers may cause
inefficiencies.protected void commit(java.util.Queue<java.nio.ByteBuffer> buffers, Callback callback)