public class HttpServerMultiplexChannelHandler extends org.jboss.netty.channel.SimpleChannelUpstreamHandler implements HttpServerConsumerChannelFactory
HttpServerPipelineFactory 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.
|
int |
consumers()
Number of active consumers
|
void |
exceptionCaught(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.ExceptionEvent e) |
org.jboss.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 |
messageReceived(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.MessageEvent messageEvent) |
void |
removeConsumer(NettyHttpConsumer consumer)
Removes the given consumer
|
public 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 org.jboss.netty.channel.ChannelHandler getChannelHandler()
HttpServerConsumerChannelFactoryChannelHandlergetChannelHandler in interface HttpServerConsumerChannelFactorypublic void messageReceived(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.MessageEvent messageEvent)
throws Exception
messageReceived in class org.jboss.netty.channel.SimpleChannelUpstreamHandlerExceptionApache Camel