Package org.apache.camel.component.netty
Class DefaultNettyCamelStateCorrelationManager
java.lang.Object
org.apache.camel.component.netty.DefaultNettyCamelStateCorrelationManager
- All Implemented Interfaces:
NettyCamelStateCorrelationManager
public class DefaultNettyCamelStateCorrelationManager
extends Object
implements NettyCamelStateCorrelationManager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the state when a response message has been received.getState(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.Channel channel, Throwable cause) Gets the state when some internal error occurred.voidputState(io.netty.channel.Channel channel, NettyCamelState state) Puts the state.voidremoveState(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.Channel channel) Removes the state when the channel is inactive.
-
Constructor Details
-
DefaultNettyCamelStateCorrelationManager
public DefaultNettyCamelStateCorrelationManager()
-
-
Method Details
-
putState
Description copied from interface:NettyCamelStateCorrelationManagerPuts the state. You can get access to the Camel message from theNettyCamelStateinstance.- Specified by:
putStatein interfaceNettyCamelStateCorrelationManager- Parameters:
channel- the channelstate- the Camel state to be stored
-
removeState
public void removeState(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.Channel channel) Description copied from interface:NettyCamelStateCorrelationManagerRemoves the state when the channel is inactive.- Specified by:
removeStatein interfaceNettyCamelStateCorrelationManager- Parameters:
ctx- netty channel handler contextchannel- the channel
-
getState
public NettyCamelState getState(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.Channel channel, Object msg) Description copied from interface:NettyCamelStateCorrelationManagerGets the state when a response message has been received. If the implementation stores the state temporary in for example aMapinstance then this method should remove the state from the map as its no longer needed. In other words use theMap.remove(Object)to get and remove the state.- Specified by:
getStatein interfaceNettyCamelStateCorrelationManager- Parameters:
ctx- netty channel handler contextchannel- the channelmsg- the response message
-
getState
public NettyCamelState getState(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.Channel channel, Throwable cause) Description copied from interface:NettyCamelStateCorrelationManagerGets the state when some internal error occurred.- Specified by:
getStatein interfaceNettyCamelStateCorrelationManager- Parameters:
ctx- netty channel handler contextchannel- the channelcause- the error
-