Package org.eclipse.jetty.server.handler
Class BufferedResponseHandler.BufferedInterceptor
- java.lang.Object
-
- org.eclipse.jetty.server.handler.BufferedResponseHandler.BufferedInterceptor
-
- All Implemented Interfaces:
HttpOutput.Interceptor
- Enclosing class:
- BufferedResponseHandler
private class BufferedResponseHandler.BufferedInterceptor extends java.lang.Object implements HttpOutput.Interceptor
-
-
Field Summary
Fields Modifier and Type Field 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 Summary
Constructors Constructor Description BufferedInterceptor(HttpChannel httpChannel, HttpOutput.Interceptor interceptor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Field Detail
-
_next
final HttpOutput.Interceptor _next
-
_channel
final HttpChannel _channel
-
_buffers
final java.util.Queue<java.nio.ByteBuffer> _buffers
-
_aggregating
java.lang.Boolean _aggregating
-
_aggregate
java.nio.ByteBuffer _aggregate
-
-
Constructor Detail
-
BufferedInterceptor
public BufferedInterceptor(HttpChannel httpChannel, HttpOutput.Interceptor interceptor)
-
-
Method Detail
-
resetBuffer
public void resetBuffer()
Description copied from interface:HttpOutput.Interceptor
Reset the buffers.If the Interceptor contains buffers then reset them.
- Specified by:
resetBuffer
in interfaceHttpOutput.Interceptor
-
write
public void write(java.nio.ByteBuffer content, boolean last, Callback callback)
Description copied from interface:HttpOutput.Interceptor
Write content. The response is committed by the first call to write and is closed by a call with last == true. Empty content buffers may be passed to force a commit or close.- Specified by:
write
in interfaceHttpOutput.Interceptor
- Parameters:
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 indicateCallback.succeeded()
orCallback.failed(Throwable)
.
-
getNextInterceptor
public HttpOutput.Interceptor getNextInterceptor()
- Specified by:
getNextInterceptor
in interfaceHttpOutput.Interceptor
- Returns:
- The next Interceptor in the chain or null if this is the last Interceptor in the chain.
-
isOptimizedForDirectBuffers
public boolean isOptimizedForDirectBuffers()
- Specified by:
isOptimizedForDirectBuffers
in interfaceHttpOutput.Interceptor
- Returns:
- True if the Interceptor is optimized to receive direct
ByteBuffer
s in theHttpOutput.Interceptor.write(ByteBuffer, boolean, Callback)
method. If false is returned, then passing direct buffers may cause inefficiencies.
-
commit
protected void commit(java.util.Queue<java.nio.ByteBuffer> buffers, Callback callback)
-
-