@ChannelHandler.Sharable public class HttpServerMultiplexChannelHandler extends io.netty.channel.SimpleChannelInboundHandler<Object> implements HttpServerConsumerChannelFactory
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| Constructor and Description |
|---|
HttpServerMultiplexChannelHandler() |
| Modifier and Type | Method and 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
|
acceptInboundMessage, channelReadchannelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggeredensureNotSharable, handlerAdded, handlerRemoved, isSharablepublic void init(int port)
HttpServerConsumerChannelFactoryinit in interface HttpServerConsumerChannelFactorypublic void addConsumer(NettyHttpConsumer consumer)
HttpServerConsumerChannelFactoryaddConsumer in interface HttpServerConsumerChannelFactorypublic void removeConsumer(NettyHttpConsumer consumer)
HttpServerConsumerChannelFactoryremoveConsumer in interface HttpServerConsumerChannelFactorypublic int consumers()
HttpServerConsumerChannelFactoryconsumers in interface HttpServerConsumerChannelFactorypublic int getPort()
HttpServerConsumerChannelFactorygetPort in interface HttpServerConsumerChannelFactorypublic io.netty.channel.ChannelHandler getChannelHandler()
HttpServerConsumerChannelFactoryChannelHandlergetChannelHandler in interface HttpServerConsumerChannelFactoryprotected void channelRead0(io.netty.channel.ChannelHandlerContext ctx,
Object msg)
throws Exception
public void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
Throwable cause)
throws Exception
exceptionCaught in interface io.netty.channel.ChannelHandlerexceptionCaught in interface io.netty.channel.ChannelInboundHandlerexceptionCaught in class io.netty.channel.ChannelInboundHandlerAdapterExceptionApache Camel