- All Known Subinterfaces:
- All Known Implementing Classes:
- Enclosing class:
public static interface HttpOutput.InterceptorThe 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.
Responses are committed by the first call to
write(ByteBuffer, boolean, Callback)and closed by a call to
write(ByteBuffer, boolean, Callback)with the last boolean set true. If no content is available to commit or close, then a null buffer is passed.
void write(java.nio.ByteBuffer content, boolean last, Callback callback)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.
- The next Interceptor in the chain or null if this is the last Interceptor in the chain.
default void resetBuffer() throws java.lang.IllegalStateExceptionReset the buffers.
If the Interceptor contains buffers then reset them.
java.lang.IllegalStateException- Thrown if the response has been committed and buffers and/or headers cannot be reset.