Interface RequestHandler
- All Known Implementing Classes:
NettyServerWebSocketUpgradeHandler,RoutingInBoundHandler
Handler for incoming requests.
- Since:
- 4.0.0
- Author:
- Jonas Konrad
-
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.HttpRequest request, CloseableByteBody body, OutboundAccess outboundAccess) Handle a request.voidhandleUnboundError(Throwable cause) Handle an error that is not bound to a request, i.e.default voidremoved()Called when the handler is removed.default voidresponseWritten(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, CloseableByteBody body, OutboundAccess outboundAccess) Handle a request.- Parameters:
ctx- The context this request came in onrequest- The request line and headersbody- The request bodyoutboundAccess- TheOutboundAccessto 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 responsePublisherhas been fully consumed.
This is used for cleaning up the request.- Parameters:
attachment- Object passed toOutboundAccess.attachment(Object)
-
removed
default void removed()Called when the handler is removed.
-