Package io.micronaut.http.server.netty
Class RoutingInBoundHandler
java.lang.Object
io.micronaut.http.server.netty.RoutingInBoundHandler
- All Implemented Interfaces:
RequestHandler
@Internal
@Sharable
public final class RoutingInBoundHandler
extends Object
implements RequestHandler
Internal implementation of the
ChannelInboundHandler
for Micronaut.- Since:
- 1.0
- Author:
- Graeme Rocher
-
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.void
responseWritten
(Object attachment) Called roughly when a response has been written.void
writeResponse
(PipeliningServerHandler.OutboundAccess outboundAccess, NettyHttpRequest<?> nettyHttpRequest, HttpResponse<?> response, Throwable throwable) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.http.server.netty.handler.RequestHandler
removed
-
Method Details
-
responseWritten
Description copied from interface:RequestHandler
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.- Specified by:
responseWritten
in interfaceRequestHandler
- Parameters:
attachment
- Object passed toPipeliningServerHandler.OutboundAccess.attachment(Object)
-
handleUnboundError
Description copied from interface:RequestHandler
Handle an error that is not bound to a request, i.e. happens outside aStreamedHttpRequest
.- Specified by:
handleUnboundError
in interfaceRequestHandler
- Parameters:
cause
- The error
-
accept
public void accept(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.HttpRequest request, ByteBody body, PipeliningServerHandler.OutboundAccess outboundAccess) Description copied from interface:RequestHandler
Handle a request.- Specified by:
accept
in interfaceRequestHandler
- 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
-
writeResponse
public void writeResponse(PipeliningServerHandler.OutboundAccess outboundAccess, NettyHttpRequest<?> nettyHttpRequest, HttpResponse<?> response, Throwable throwable)
-