Class HttpServerMultiplexChannelHandler

  • All Implemented Interfaces:
    io.netty.channel.ChannelHandler, io.netty.channel.ChannelInboundHandler, HttpServerConsumerChannelFactory

    @Sharable
    public class HttpServerMultiplexChannelHandler
    extends io.netty.channel.SimpleChannelInboundHandler<Object>
    implements HttpServerConsumerChannelFactory
    A multiplex HttpServerInitializerFactory which keeps a list of handlers, and delegates to the target handler based on the http context path in the incoming request. This is used to allow to reuse the same Netty consumer, allowing to have multiple routes on the same netty ServerBootstrap
    • Nested Class Summary

      • 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
      void addConsumer​(NettyHttpConsumer consumer)
      Adds the given consumer.
      protected void channelRead0​(io.netty.channel.ChannelHandlerContext ctx, Object msg)  
      int consumers()
      Number of active consumers
      void exceptionCaught​(io.netty.channel.ChannelHandlerContext ctx, Throwable cause)  
      io.netty.channel.ChannelHandler getChannelHandler()
      Gets the ChannelHandler
      int getPort()
      The port number this consumer channel factory is using.
      void init​(int port)
      Initializes this consumer channel factory with the given port.
      void removeConsumer​(NettyHttpConsumer consumer)
      Removes the given consumer
      • Methods inherited from class io.netty.channel.SimpleChannelInboundHandler

        acceptInboundMessage, channelRead
      • Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter

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

        ensureNotSharable, handlerAdded, handlerRemoved, isSharable
      • Methods inherited from interface io.netty.channel.ChannelHandler

        handlerAdded, handlerRemoved