Class AsyncFullHttpRequestHandler
- java.lang.Object
-
- io.netty.channel.ChannelHandlerAdapter
-
- io.netty.channel.ChannelInboundHandlerAdapter
-
- com.linkedin.alpini.netty4.handlers.ChannelInitializer<io.netty.channel.Channel>
-
- com.linkedin.alpini.netty4.handlers.AsyncFullHttpRequestHandler
-
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler
@Sharable public class AsyncFullHttpRequestHandler extends ChannelInitializer<io.netty.channel.Channel>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceAsyncFullHttpRequestHandler.RequestHandler
-
Constructor Summary
Constructors Constructor Description AsyncFullHttpRequestHandler(AsyncFullHttpRequestHandler.RequestHandler handler, java.util.function.BooleanSupplier shutdownFlag)AsyncFullHttpRequestHandler(AsyncFullHttpRequestHandler.RequestHandler handler, java.util.function.BooleanSupplier shutdownFlag, java.util.function.BooleanSupplier busyAutoReadDisable)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected io.netty.handler.codec.http.FullHttpResponsebuildErrorResponse(io.netty.handler.codec.http.HttpRequest msg, java.lang.Throwable ex)protected io.netty.handler.codec.http.FullHttpResponsebuildErrorResponse(io.netty.handler.codec.http.HttpRequest msg, java.lang.Throwable ex, io.netty.handler.codec.http.HttpResponseStatus responseStatus)protected io.netty.handler.codec.http.HttpResponseStatusgetResponseStatus(java.lang.Throwable ex)protected voidinitChannel(io.netty.channel.Channel ch)This method will be called once theChannelwas registered.protected io.netty.channel.ChannelFuturewriteAndFlushResponse(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.FullHttpResponse msg)-
Methods inherited from class com.linkedin.alpini.netty4.handlers.ChannelInitializer
channelRegistered, currentContext, exceptionCaught, handlerAdded, handlerRemoved
-
-
-
-
Constructor Detail
-
AsyncFullHttpRequestHandler
public AsyncFullHttpRequestHandler(@Nonnull AsyncFullHttpRequestHandler.RequestHandler handler, @Nonnull java.util.function.BooleanSupplier shutdownFlag)
-
AsyncFullHttpRequestHandler
public AsyncFullHttpRequestHandler(@Nonnull AsyncFullHttpRequestHandler.RequestHandler handler, @Nonnull java.util.function.BooleanSupplier shutdownFlag, @Nonnull java.util.function.BooleanSupplier busyAutoReadDisable)
-
-
Method Detail
-
initChannel
protected void initChannel(io.netty.channel.Channel ch) throws java.lang.ExceptionDescription copied from class:ChannelInitializerThis method will be called once theChannelwas registered. After the method returns this instance will be removed from theChannelPipelineof theChannel.- Specified by:
initChannelin classChannelInitializer<io.netty.channel.Channel>- Parameters:
ch- theChannelwhich was registered.- Throws:
java.lang.Exception- is thrown if an error occurs. In that case it will be handled byChannelInitializer.exceptionCaught(ChannelHandlerContext, Throwable)which will by default close theChannel.
-
writeAndFlushResponse
protected io.netty.channel.ChannelFuture writeAndFlushResponse(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.FullHttpResponse msg)
-
getResponseStatus
@Nonnull protected io.netty.handler.codec.http.HttpResponseStatus getResponseStatus(@Nonnull java.lang.Throwable ex)
-
buildErrorResponse
@Nonnull protected io.netty.handler.codec.http.FullHttpResponse buildErrorResponse(@Nonnull io.netty.handler.codec.http.HttpRequest msg, @Nonnull java.lang.Throwable ex)
-
buildErrorResponse
@Nonnull protected io.netty.handler.codec.http.FullHttpResponse buildErrorResponse(@Nonnull io.netty.handler.codec.http.HttpRequest msg, @Nonnull java.lang.Throwable ex, @Nonnull io.netty.handler.codec.http.HttpResponseStatus responseStatus)
-
-