Package org.apache.camel.component.netty
Interface NettyCamelStateCorrelationManager
-
- All Known Implementing Classes:
DefaultNettyCamelStateCorrelationManager
,TimeoutCorrelationManagerSupport
public interface NettyCamelStateCorrelationManager
To manage and correlate state ofNettyCamelState
when doing request/reply viaNettyProducer
. This SPI allows custom implementations to correlate the request and replies.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method 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.
-
-
-
Method Detail
-
putState
void putState(io.netty.channel.Channel channel, NettyCamelState state)
Puts the state. You can get access to the Camel message from theNettyCamelState
instance.- Parameters:
channel
- the channelstate
- the Camel state to be stored
-
removeState
void removeState(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.Channel channel)
Removes the state when the channel is inactive.- Parameters:
ctx
- netty channel handler contextchannel
- the channel
-
getState
NettyCamelState getState(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.Channel channel, Object msg)
Gets the state when a response message has been received. If the implementation stores the state temporary in for example aMap
instance 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.- Parameters:
ctx
- netty channel handler contextchannel
- the channelmsg
- the response message
-
getState
NettyCamelState getState(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.Channel channel, Throwable cause)
Gets the state when some internal error occurred.- Parameters:
ctx
- netty channel handler contextchannel
- the channelcause
- the error
-
-