Class 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 interface  AsyncFullHttpRequestHandler.RequestHandler  
      • Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler

        io.netty.channel.ChannelHandler.Sharable
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected io.netty.handler.codec.http.FullHttpResponse buildErrorResponse​(io.netty.handler.codec.http.HttpRequest msg, java.lang.Throwable ex)  
      protected io.netty.handler.codec.http.FullHttpResponse buildErrorResponse​(io.netty.handler.codec.http.HttpRequest msg, java.lang.Throwable ex, io.netty.handler.codec.http.HttpResponseStatus responseStatus)  
      protected io.netty.handler.codec.http.HttpResponseStatus getResponseStatus​(java.lang.Throwable ex)  
      protected void initChannel​(io.netty.channel.Channel ch)
      This method will be called once the Channel was registered.
      protected io.netty.channel.ChannelFuture writeAndFlushResponse​(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.FullHttpResponse msg)  
      • Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter

        channelActive, channelInactive, channelRead, channelReadComplete, channelUnregistered, channelWritabilityChanged, userEventTriggered
      • Methods inherited from class io.netty.channel.ChannelHandlerAdapter

        ensureNotSharable, isSharable
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • 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.Exception
        Description copied from class: ChannelInitializer
        This method will be called once the Channel was registered. After the method returns this instance will be removed from the ChannelPipeline of the Channel.
        Specified by:
        initChannel in class ChannelInitializer<io.netty.channel.Channel>
        Parameters:
        ch - the Channel which was registered.
        Throws:
        java.lang.Exception - is thrown if an error occurs. In that case it will be handled by ChannelInitializer.exceptionCaught(ChannelHandlerContext, Throwable) which will by default close the Channel.
      • 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)