passing data between ChannelHandlers
Matt DeLuco
list_usr at spacebox.net
Thu Oct 20 22:49:37 EDT 2011
Where can I find some examples of ChannelLocal in use?
I'm not getting the results I expect, but I don't think I'm using it
correctly either.
MD
On Sun, Oct 16, 2011 at 7:14 AM, Norman Maurer <norman.maurer at googlemail.com
> wrote:
> You can set anything you want as attachment. But it's only visible in
> the same handler....
>
> If you want to share stuff between handler you should checkout ChannelLocal
>
> Bye
> Norman
> 2011/10/16, Matt DeLuco <list_usr at spacebox.net>:
> > Before composing this message I had noticed
> > ChannelHandlerContext.setAttachment(Object) and getAttachment(). But
> > for some reason I came to the conclusion that it wasn't intended for
> > what I want to do.
> >
> > I came to that conclusion in part because I found it strange that it's
> > only possible to set one attachment, rather than being able to attach
> > a set (or map) of objects. Could I just attach a map to the context
> > and store whatever I want in that map, to pass objects between
> > ChannelHandlers?
> >
> > MD
> >
> >
> > On Sat, Oct 15, 2011 at 9:42 PM, Matt DeLuco <list_usr at spacebox.net>
> wrote:
> >> Is it possible to pass data between ChannelHandlers, or store data
> >> somewhere that the handlers in a specific pipeline/channel can access
> >> throughout the lifetime of the request?
> >>
> >> For example, I have my own class for dealing with http cookies,
> >> "CookieMap". I'd like to have a SimpleChannelHandler that creates a
> >> CookieMap to be used by handlers further upstream, and then sets the
> >> cookies in the CookieMap on the response on their way back downstream.
> >>
> >> MD
> >>
> >
> > _______________________________________________
> > netty-users mailing list
> > netty-users at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/netty-users
> >
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/netty-users/attachments/20111020/1ffafafc/attachment.html
More information about the netty-users
mailing list