org.apache.camel.component.netty.handlers
Class ClientChannelHandler

java.lang.Object
  extended by org.jboss.netty.channel.SimpleChannelUpstreamHandler
      extended by org.apache.camel.component.netty.handlers.ClientChannelHandler
All Implemented Interfaces:
org.jboss.netty.channel.ChannelHandler, org.jboss.netty.channel.ChannelUpstreamHandler

public class ClientChannelHandler
extends org.jboss.netty.channel.SimpleChannelUpstreamHandler

Client handler which cannot be shared


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jboss.netty.channel.ChannelHandler
org.jboss.netty.channel.ChannelHandler.Sharable
 
Constructor Summary
ClientChannelHandler(NettyProducer producer)
           
 
Method Summary
 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 channelStateEvent)
           
 void exceptionCaught(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.ExceptionEvent exceptionEvent)
           
protected  org.apache.camel.Message getResponseMessage(org.apache.camel.Exchange exchange, org.jboss.netty.channel.MessageEvent messageEvent)
          Gets the Camel Message to use as the message to be set on the current Exchange when we have received a reply message.
 void messageReceived(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.MessageEvent messageEvent)
           
 
Methods inherited from class org.jboss.netty.channel.SimpleChannelUpstreamHandler
channelBound, channelConnected, channelDisconnected, channelInterestChanged, channelUnbound, childChannelClosed, childChannelOpen, handleUpstream, writeComplete
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientChannelHandler

public ClientChannelHandler(NettyProducer producer)
Method Detail

channelOpen

public void channelOpen(org.jboss.netty.channel.ChannelHandlerContext ctx,
                        org.jboss.netty.channel.ChannelStateEvent channelStateEvent)
                 throws Exception
Overrides:
channelOpen in class org.jboss.netty.channel.SimpleChannelUpstreamHandler
Throws:
Exception

exceptionCaught

public void exceptionCaught(org.jboss.netty.channel.ChannelHandlerContext ctx,
                            org.jboss.netty.channel.ExceptionEvent exceptionEvent)
                     throws Exception
Overrides:
exceptionCaught in class org.jboss.netty.channel.SimpleChannelUpstreamHandler
Throws:
Exception

channelClosed

public void channelClosed(org.jboss.netty.channel.ChannelHandlerContext ctx,
                          org.jboss.netty.channel.ChannelStateEvent e)
                   throws Exception
Overrides:
channelClosed in class org.jboss.netty.channel.SimpleChannelUpstreamHandler
Throws:
Exception

messageReceived

public void messageReceived(org.jboss.netty.channel.ChannelHandlerContext ctx,
                            org.jboss.netty.channel.MessageEvent messageEvent)
                     throws Exception
Overrides:
messageReceived in class org.jboss.netty.channel.SimpleChannelUpstreamHandler
Throws:
Exception

getResponseMessage

protected org.apache.camel.Message getResponseMessage(org.apache.camel.Exchange exchange,
                                                      org.jboss.netty.channel.MessageEvent messageEvent)
                                               throws Exception
Gets the Camel Message to use as the message to be set on the current Exchange when we have received a reply message.

Parameters:
exchange - the current exchange
messageEvent - the incoming event which has the response message from Netty.
Returns:
the Camel Message to set on the current Exchange as the response message.
Throws:
Exception - is thrown if error getting the response message


Apache Camel