I would like to create a pipeline of handlers, for example:
public ChannelPipeline getPipeline() throws Exception { return Channels.pipeline( new ObjectEncoder(), new ObjectDecoder(), new AuthenticationServerHandler(), new BusinessLogicServerHandler()); }
The key point here is that I would like the AuthenticationServerHandler to pass login information to the BusinessLogicServerHandler .
I understand that you can use Attachment , but it only stores information for this handler, other handlers in the pipeline cannot access it. I also noticed that there is something called ChannelLocal that could do the trick, however I cannot find any real information on how to use it. All I saw are people who create a static instance for it, but how do you retrieve and access information in another handler? Assuming the correct method.
My question is: how do you pass information between handlers in the same pipeline. In the example above, how do I pass login credentials from AuthenticationServerHandler to BusinessLogicServerHandler ?
source share