Interface RequestHandler
- All Known Implementing Classes:
NettyServerWebSocketUpgradeHandler,RoutingInBoundHandler
@Internal
public interface RequestHandler
Handler for incoming requests.
- Since:
- 4.0.0
-
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.HttpRequest request, PipeliningServerHandler.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, PipeliningServerHandler.OutboundAccess outboundAccess) Handle a request.- Parameters:
ctx- The context this request came in onrequest- The request, either aFullHttpRequestor aStreamedHttpRequestoutboundAccess- ThePipeliningServerHandler.OutboundAccessto use for writing the response
-
handleUnboundError
Handle an error that is not bound to a request, i.e. happens outside of 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 toPipeliningServerHandler.OutboundAccess.attachment(Object)
-
removed
default void removed()Called when the handler is removed.
-