public class ServerChannelHandler
extends org.jboss.netty.channel.SimpleChannelUpstreamHandler
Constructor and Description |
---|
ServerChannelHandler(NettyConsumer consumer) |
Modifier and Type | Method and Description |
---|---|
protected void |
beforeProcess(org.apache.camel.Exchange exchange,
org.jboss.netty.channel.MessageEvent messageEvent)
Allows any custom logic before the
Exchange is processed by the routing engine. |
void |
channelClosed(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.ChannelStateEvent e) |
void |
channelOpen(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.ChannelStateEvent e) |
protected org.jboss.netty.channel.ChannelFutureListener |
createResponseFutureListener(NettyConsumer consumer,
org.apache.camel.Exchange exchange,
SocketAddress remoteAddress)
Creates the
ChannelFutureListener to execute when writing the response is complete. |
void |
exceptionCaught(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.ExceptionEvent exceptionEvent) |
protected Object |
getResponseBody(org.apache.camel.Exchange exchange)
Gets the object we want to use as the response object for sending to netty.
|
void |
messageReceived(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.MessageEvent messageEvent) |
public ServerChannelHandler(NettyConsumer consumer)
public void channelOpen(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.ChannelStateEvent e) throws Exception
channelOpen
in class org.jboss.netty.channel.SimpleChannelUpstreamHandler
Exception
public void channelClosed(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.ChannelStateEvent e) throws Exception
channelClosed
in class org.jboss.netty.channel.SimpleChannelUpstreamHandler
Exception
public void exceptionCaught(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.ExceptionEvent exceptionEvent) throws Exception
exceptionCaught
in class org.jboss.netty.channel.SimpleChannelUpstreamHandler
Exception
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
protected void beforeProcess(org.apache.camel.Exchange exchange, org.jboss.netty.channel.MessageEvent messageEvent)
Exchange
is processed by the routing engine.exchange
- the exchangemessageEvent
- the Netty message eventprotected Object getResponseBody(org.apache.camel.Exchange exchange) throws Exception
exchange
- the exchangeException
- is thrown if error getting the response bodyprotected org.jboss.netty.channel.ChannelFutureListener createResponseFutureListener(NettyConsumer consumer, org.apache.camel.Exchange exchange, SocketAddress remoteAddress)
ChannelFutureListener
to execute when writing the response is complete.consumer
- the netty consumerexchange
- the exchangeremoteAddress
- the remote address of the messageApache Camel