Package org.eclipse.jetty.server
Interface HttpOutput.Interceptor
-
- All Known Implementing Classes:
GzipHttpOutputInterceptor
,HttpChannel
,HttpChannelOverHttp
- Enclosing class:
- HttpOutput
@Deprecated(since="2021-05-27") public static interface HttpOutput.Interceptor
Deprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.The HttpOutput.Interceptor is a single intercept point for all output written to the HttpOutput: via writer; via output stream; asynchronously; or blocking.The Interceptor can be used to implement translations (eg Gzip) or additional buffering that acts on all output. Interceptors are created in a chain, so that multiple concerns may intercept.
The
HttpChannel
is anHttpOutput.Interceptor
and is always the last link in any Interceptor chain.Responses are committed by the first call to
write(ByteBuffer, boolean, Callback)
and closed by a call towrite(ByteBuffer, boolean, Callback)
with the last boolean set true. If no content is available to commit or close, then a null buffer is passed.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description HttpOutput.Interceptor
getNextInterceptor()
Deprecated.boolean
isOptimizedForDirectBuffers()
Deprecated.default void
resetBuffer()
Deprecated.Reset the buffers.void
write(java.nio.ByteBuffer content, boolean last, Callback callback)
Deprecated.Write content.
-
-
-
Method Detail
-
write
void write(java.nio.ByteBuffer content, boolean last, Callback callback)
Deprecated.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.- 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
HttpOutput.Interceptor getNextInterceptor()
Deprecated.- Returns:
- The next Interceptor in the chain or null if this is the last Interceptor in the chain.
-
isOptimizedForDirectBuffers
boolean isOptimizedForDirectBuffers()
Deprecated.- Returns:
- True if the Interceptor is optimized to receive direct
ByteBuffer
s in thewrite(ByteBuffer, boolean, Callback)
method. If false is returned, then passing direct buffers may cause inefficiencies.
-
resetBuffer
default void resetBuffer() throws java.lang.IllegalStateException
Deprecated.Reset the buffers.If the Interceptor contains buffers then reset them.
- Throws:
java.lang.IllegalStateException
- Thrown if the response has been committed and buffers and/or headers cannot be reset.
-
-