Interface HttpOutput.Interceptor

All Known Subinterfaces:
BufferedResponseHandler.BufferedInterceptor
All Known Implementing Classes:
GzipHttpOutputInterceptor, HTTP2ServerConnection.ServerHttpChannelOverHTTP2, HttpChannel, HttpChannelOverFCGI, HttpChannelOverHttp, HttpChannelOverHTTP2
Enclosing class:
HttpOutput

public static interface HttpOutput.Interceptor
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 an HttpOutput.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 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.