public class DefaultNettyCamelStateCorrelationManager extends Object implements NettyCamelStateCorrelationManager
Constructor and Description |
---|
DefaultNettyCamelStateCorrelationManager() |
Modifier and Type | Method and Description |
---|---|
NettyCamelState |
getState(io.netty.channel.ChannelHandlerContext ctx,
io.netty.channel.Channel channel,
Object msg)
Gets the state when a response message has been received.
|
NettyCamelState |
getState(io.netty.channel.ChannelHandlerContext ctx,
io.netty.channel.Channel channel,
Throwable cause)
Gets the state when some internal error occurred.
|
void |
putState(io.netty.channel.Channel channel,
NettyCamelState state)
Puts the state.
|
void |
removeState(io.netty.channel.ChannelHandlerContext ctx,
io.netty.channel.Channel channel)
Removes the state when the channel is inactive.
|
public DefaultNettyCamelStateCorrelationManager()
public void putState(io.netty.channel.Channel channel, NettyCamelState state)
NettyCamelStateCorrelationManager
NettyCamelState
instance.putState
in interface NettyCamelStateCorrelationManager
channel
- the channelstate
- the Camel state to be storedpublic void removeState(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.Channel channel)
NettyCamelStateCorrelationManager
removeState
in interface NettyCamelStateCorrelationManager
ctx
- netty channel handler contextchannel
- the channelpublic NettyCamelState getState(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.Channel channel, Object msg)
NettyCamelStateCorrelationManager
Map
instance
then this method should remove the state from the map as its no longer needed. In other
words use the Map.remove(Object)
to get and remove the state.getState
in interface NettyCamelStateCorrelationManager
ctx
- netty channel handler contextchannel
- the channelmsg
- the response messagepublic NettyCamelState getState(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.Channel channel, Throwable cause)
NettyCamelStateCorrelationManager
getState
in interface NettyCamelStateCorrelationManager
ctx
- netty channel handler contextchannel
- the channelcause
- the errorApache Camel