Package org.eclipse.jetty.server.handler
Class BufferedResponseHandler.ArrayBufferedInterceptor
- java.lang.Object
-
- org.eclipse.jetty.server.handler.BufferedResponseHandler.ArrayBufferedInterceptor
-
- All Implemented Interfaces:
BufferedResponseHandler.BufferedInterceptor,HttpOutput.Interceptor
- Enclosing class:
- BufferedResponseHandler
class BufferedResponseHandler.ArrayBufferedInterceptor extends java.lang.Object implements BufferedResponseHandler.BufferedInterceptor
-
-
Field Summary
Fields Modifier and Type Field Description private java.nio.ByteBuffer_aggregateprivate java.lang.Boolean_aggregatingprivate java.util.Queue<java.nio.ByteBuffer>_buffersprivate HttpChannel_channelprivate HttpOutput.Interceptor_next
-
Constructor Summary
Constructors Constructor Description ArrayBufferedInterceptor(HttpChannel httpChannel, HttpOutput.Interceptor interceptor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidcommit(Callback callback)HttpOutput.InterceptorgetNextInterceptor()booleanisOptimizedForDirectBuffers()voidresetBuffer()Reset the buffers.voidwrite(java.nio.ByteBuffer content, boolean last, Callback callback)Write content.
-
-
-
Field Detail
-
_next
private final HttpOutput.Interceptor _next
-
_channel
private final HttpChannel _channel
-
_buffers
private final java.util.Queue<java.nio.ByteBuffer> _buffers
-
_aggregating
private java.lang.Boolean _aggregating
-
_aggregate
private java.nio.ByteBuffer _aggregate
-
-
Constructor Detail
-
ArrayBufferedInterceptor
public ArrayBufferedInterceptor(HttpChannel httpChannel, HttpOutput.Interceptor interceptor)
-
-
Method Detail
-
getNextInterceptor
public HttpOutput.Interceptor getNextInterceptor()
- Specified by:
getNextInterceptorin 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:
isOptimizedForDirectBuffersin interfaceHttpOutput.Interceptor- Returns:
- True if the Interceptor is optimized to receive direct
ByteBuffers in theHttpOutput.Interceptor.write(ByteBuffer, boolean, Callback)method. If false is returned, then passing direct buffers may cause inefficiencies.
-
resetBuffer
public void resetBuffer()
Description copied from interface:HttpOutput.InterceptorReset the buffers.If the Interceptor contains buffers then reset them.
- Specified by:
resetBufferin interfaceHttpOutput.Interceptor
-
write
public void write(java.nio.ByteBuffer content, boolean last, Callback callback)Description copied from interface:HttpOutput.InterceptorWrite 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:
writein 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).
-
commit
private void commit(Callback callback)
-
-