On that topic, is there a VCS from which netty can be downloaded?<div><br></div><div>MD</div><div><br><br><div class="gmail_quote">On Mon, Oct 24, 2011 at 10:37 PM, Matt DeLuco <span dir="ltr"><<a href="mailto:list_usr@spacebox.net">list_usr@spacebox.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Thank you, Norman!<div><br></div><div>I have to say though, this all seems like a very roundabout way of keeping track of session data for a Channel.</div>
<div><br></div><div>Is there any interest in adding a session interface to HttpRequest, something like javax.servlet.http.HttpSession found in javax.servlet.http.HttpRequest?</div>
<div><br></div><div>I thought if there was an interface one could implement the storage mechanism - file/database/memcached, etc.</div><div><br></div><font color="#888888"><div>MD</div></font><div><div></div><div class="h5">
<div><br><br><div class="gmail_quote">On Mon, Oct 24, 2011 at 6:16 AM, Norman Maurer <span dir="ltr"><<a href="mailto:norman.maurer@googlemail.com" target="_blank">norman.maurer@googlemail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi there,<br>
<br>
just to follow up. I committed some code to handle the removal without<br>
user interaction:<br>
<br>
<a href="https://issues.jboss.org/browse/NETTY-447?page=com.atlassian.jirafisheyeplugin:fisheye-issuepanel#issue-tabs" target="_blank">https://issues.jboss.org/browse/NETTY-447?page=com.atlassian.jirafisheyeplugin:fisheye-issuepanel#issue-tabs</a><br>
<br>
So it will be in the next release...<br>
<br>
Bye<br>
Norman<br>
<br>
2011/10/24 Norman Maurer <<a href="mailto:norman.maurer@googlemail.com" target="_blank">norman.maurer@googlemail.com</a>>:<br>
<div><div></div><div>> Hi Matt,<br>
><br>
> comments inline..<br>
><br>
> 2011/10/24 Matt DeLuco <<a href="mailto:list_usr@spacebox.net" target="_blank">list_usr@spacebox.net</a>>:<br>
>> I found what I was looking for - a brief example of ChannelLocal is found in<br>
>> the ChannelHandler documentation (ps: it might be worth repeating in the<br>
>> ChannelLocal docs..) But now I'm wondering:<br>
>> The example shows a DataServerState class - where would that class be<br>
>> instantiated such that all handlers have access to it? I thought I might<br>
>> instantiate it in my server startup code, pass it to the<br>
>> ChannelPipelineFactory where I could pass it on to the constructor of each<br>
>> ChannelHandler. Is there another way?<br>
><br>
> I think thats the easiest way and should work very well.<br>
><br>
>> Also, at some point before the Channel closes would I have to be sure to<br>
>> remove any ChannelLocal variable references? That is, ChannelLocals map<br>
>> values to Channels, so would I have to be sure to remove each reference so<br>
>> values to closed Channels don't pile up, creating a memory leak? If so,<br>
>> how/where could I attach an event handler to a Channel to do this? Would I<br>
>> have to do this in a ChannelHandler (I don't like that idea, because which<br>
>> ChannelHandler do I put it in?) or create some kind of custom<br>
>> ChannelFactory?<br>
><br>
> Just add an SimpleUpstreamChannelHandler and override the<br>
> channelClosed(..) method. There you can remove it.<br>
> I think it would also be nice to allow the ChannelLocal to cleanup it<br>
> self by register and ChannelListener to it that takes care of the<br>
> remove and so prevent the leak. I will open a jira issue for it and<br>
> implement it.<br>
><br>
><br>
>> Thanks.<br>
>> MD<br>
>><br>
>> On Fri, Oct 21, 2011 at 3:36 AM, Norman Maurer<br>
>> <<a href="mailto:norman.maurer@googlemail.com" target="_blank">norman.maurer@googlemail.com</a>> wrote:<br>
>>><br>
>>> I was using it before in a project but remoted it in favor of<br>
>>> ChannelHandlerContext.setAttachment(..).<br>
>>><br>
>>> But it worked quited fine for me. You can see the old code here:<br>
>>><br>
>>><br>
>>> <a href="http://svn.apache.org/viewvc/james/protocols/tags/protocols-1.5/impl/src/main/java/org/apache/james/protocols/impl/AbstractChannelUpstreamHandler.java?view=markup" target="_blank">http://svn.apache.org/viewvc/james/protocols/tags/protocols-1.5/impl/src/main/java/org/apache/james/protocols/impl/AbstractChannelUpstreamHandler.java?view=markup</a><br>
>>><br>
>>> Bye,<br>
>>> Norman<br>
>>><br>
>>> Ps: What does not work for you ?<br>
>>><br>
>>> 2011/10/21 Matt DeLuco <<a href="mailto:list_usr@spacebox.net" target="_blank">list_usr@spacebox.net</a>>:<br>
>>> > Where can I find some examples of ChannelLocal in use?<br>
>>> > I'm not getting the results I expect, but I don't think I'm using it<br>
>>> > correctly either.<br>
>>> > MD<br>
>>> ><br>
>>> > On Sun, Oct 16, 2011 at 7:14 AM, Norman Maurer<br>
>>> > <<a href="mailto:norman.maurer@googlemail.com" target="_blank">norman.maurer@googlemail.com</a>> wrote:<br>
>>> >><br>
>>> >> You can set anything you want as attachment. But it's only visible in<br>
>>> >> the same handler....<br>
>>> >><br>
>>> >> If you want to share stuff between handler you should checkout<br>
>>> >> ChannelLocal<br>
>>> >><br>
>>> >> Bye<br>
>>> >> Norman<br>
>>> >> 2011/10/16, Matt DeLuco <<a href="mailto:list_usr@spacebox.net" target="_blank">list_usr@spacebox.net</a>>:<br>
>>> >> > Before composing this message I had noticed<br>
>>> >> > ChannelHandlerContext.setAttachment(Object) and getAttachment(). But<br>
>>> >> > for some reason I came to the conclusion that it wasn't intended for<br>
>>> >> > what I want to do.<br>
>>> >> ><br>
>>> >> > I came to that conclusion in part because I found it strange that<br>
>>> >> > it's<br>
>>> >> > only possible to set one attachment, rather than being able to attach<br>
>>> >> > a set (or map) of objects. Could I just attach a map to the context<br>
>>> >> > and store whatever I want in that map, to pass objects between<br>
>>> >> > ChannelHandlers?<br>
>>> >> ><br>
>>> >> > MD<br>
>>> >> ><br>
>>> >> ><br>
>>> >> > On Sat, Oct 15, 2011 at 9:42 PM, Matt DeLuco <<a href="mailto:list_usr@spacebox.net" target="_blank">list_usr@spacebox.net</a>><br>
>>> >> > wrote:<br>
>>> >> >> Is it possible to pass data between ChannelHandlers, or store data<br>
>>> >> >> somewhere that the handlers in a specific pipeline/channel can<br>
>>> >> >> access<br>
>>> >> >> throughout the lifetime of the request?<br>
>>> >> >><br>
>>> >> >> For example, I have my own class for dealing with http cookies,<br>
>>> >> >> "CookieMap". I'd like to have a SimpleChannelHandler that creates a<br>
>>> >> >> CookieMap to be used by handlers further upstream, and then sets the<br>
>>> >> >> cookies in the CookieMap on the response on their way back<br>
>>> >> >> downstream.<br>
>>> >> >><br>
>>> >> >> MD<br>
>>> >> >><br>
>>> >> ><br>
>>> >> > _______________________________________________<br>
>>> >> > netty-users mailing list<br>
>>> >> > <a href="mailto:netty-users@lists.jboss.org" target="_blank">netty-users@lists.jboss.org</a><br>
>>> >> > <a href="https://lists.jboss.org/mailman/listinfo/netty-users" target="_blank">https://lists.jboss.org/mailman/listinfo/netty-users</a><br>
>>> >> ><br>
>>> >> _______________________________________________<br>
>>> >> netty-users mailing list<br>
>>> >> <a href="mailto:netty-users@lists.jboss.org" target="_blank">netty-users@lists.jboss.org</a><br>
>>> >> <a href="https://lists.jboss.org/mailman/listinfo/netty-users" target="_blank">https://lists.jboss.org/mailman/listinfo/netty-users</a><br>
>>> ><br>
>>> ><br>
><br>
> Bye,<br>
> Norman<br>
><br>
<br>
_______________________________________________<br>
netty-users mailing list<br>
<a href="mailto:netty-users@lists.jboss.org" target="_blank">netty-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/netty-users" target="_blank">https://lists.jboss.org/mailman/listinfo/netty-users</a><br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>