public class ServerChannelHandler extends io.netty.channel.SimpleChannelInboundHandler<Object>
| Constructor and Description |
|---|
ServerChannelHandler(NettyConsumer consumer) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
beforeProcess(org.apache.camel.Exchange exchange,
io.netty.channel.ChannelHandlerContext ctx,
Object message)
Allows any custom logic before the
Exchange is processed by the routing engine. |
void |
channelActive(io.netty.channel.ChannelHandlerContext ctx) |
void |
channelInactive(io.netty.channel.ChannelHandlerContext ctx) |
protected void |
channelRead0(io.netty.channel.ChannelHandlerContext ctx,
Object msg) |
protected io.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(io.netty.channel.ChannelHandlerContext ctx,
Throwable cause) |
protected Object |
getResponseBody(org.apache.camel.Exchange exchange)
Gets the object we want to use as the response object for sending to netty.
|
acceptInboundMessage, channelReadchannelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggeredensureNotSharable, handlerAdded, handlerRemoved, isSharablepublic ServerChannelHandler(NettyConsumer consumer)
public void channelActive(io.netty.channel.ChannelHandlerContext ctx)
throws Exception
channelActive in interface io.netty.channel.ChannelInboundHandlerchannelActive in class io.netty.channel.ChannelInboundHandlerAdapterExceptionpublic void channelInactive(io.netty.channel.ChannelHandlerContext ctx)
throws Exception
channelInactive in interface io.netty.channel.ChannelInboundHandlerchannelInactive in class io.netty.channel.ChannelInboundHandlerAdapterExceptionpublic 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.ChannelInboundHandlerAdapterExceptionprotected void channelRead0(io.netty.channel.ChannelHandlerContext ctx,
Object msg)
throws Exception
protected void beforeProcess(org.apache.camel.Exchange exchange,
io.netty.channel.ChannelHandlerContext ctx,
Object message)
Exchange is processed by the routing engine.exchange - the exchangectx - the channel handler contextmessage - the message which needs to be sentprotected Object getResponseBody(org.apache.camel.Exchange exchange) throws Exception
exchange - the exchangeException - is thrown if error getting the response bodyprotected io.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