Interface RequestHandler
- All Known Implementing Classes:
NettyServerWebSocketUpgradeHandler
,RoutingInBoundHandler
Handler for incoming requests.
- Since:
- 4.0.0
- Author:
- Jonas Konrad
-
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.HttpRequest request, ByteBody body, PipeliningServerHandler.OutboundAccess outboundAccess) Handle a request.void
handleUnboundError
(Throwable cause) Handle an error that is not bound to a request, i.e.default void
removed()
Called when the handler is removed.default void
responseWritten
(Object attachment) Called roughly when a response has been written.
-
Method Details
-
accept
void accept(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.HttpRequest request, ByteBody body, PipeliningServerHandler.OutboundAccess outboundAccess) Handle a request.- Parameters:
ctx
- The context this request came in onrequest
- The request line and headersbody
- The request bodyoutboundAccess
- ThePipeliningServerHandler.OutboundAccess
to use for writing the response
-
handleUnboundError
Handle an error that is not bound to a request, i.e. happens outside aStreamedHttpRequest
.- Parameters:
cause
- The error
-
responseWritten
Called roughly when a response has been written. In particular, it's called when the user is "done" with the response and has no way of adding further data. The bytes may not have been fully flushed yet, but e.g. the responsePublisher
has been fully consumed.
This is used for cleaning up the request.- Parameters:
attachment
- Object passed toPipeliningServerHandler.OutboundAccess.attachment(Object)
-
removed
default void removed()Called when the handler is removed.
-