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)
HttpServerConsumerChannelFactory
init
in interface HttpServerConsumerChannelFactory
public void addConsumer(NettyHttpConsumer consumer)
HttpServerConsumerChannelFactory
addConsumer
in interface HttpServerConsumerChannelFactory
public void removeConsumer(NettyHttpConsumer consumer)
HttpServerConsumerChannelFactory
removeConsumer
in interface HttpServerConsumerChannelFactory
public int consumers()
HttpServerConsumerChannelFactory
consumers
in interface HttpServerConsumerChannelFactory
public int getPort()
HttpServerConsumerChannelFactory
getPort
in interface HttpServerConsumerChannelFactory
public org.jboss.netty.channel.ChannelHandler getChannelHandler()
HttpServerConsumerChannelFactory
ChannelHandler
getChannelHandler
in interface HttpServerConsumerChannelFactory
public void messageReceived(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.MessageEvent messageEvent) throws Exception
messageReceived
in class org.jboss.netty.channel.SimpleChannelUpstreamHandler
Exception
Apache Camel