[OS-webwork] Getting rid of thread locals
In effort to ditch the servlet paradigm, any thoughts on changing ActionContext from being a ThreadLocal to just a normal Map? I've got some code I can commit to CVS if you'd like to see how it would work. -Pat --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork
Re: [OS-webwork] Getting rid of thread locals
Err, how is ThreadLocal servlet related? How would any of the context stuff work without it? On Saturday, January 11, 2003, at 03:56 AM, Patrick Lightbody wrote: In effort to ditch the servlet paradigm, any thoughts on changing ActionContext from being a ThreadLocal to just a normal Map? I've got some code I can commit to CVS if you'd like to see how it would work. -Pat --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork
Re: [OS-webwork] Getting rid of thread locals
ThreadLocal implies that you always have a single thread throughout the lifecycle of the action (prepare, execute, print results). This is true for a servlet container (single thread/request), but not so in other areas. If you look at the code, the context Map is being passed around. I don't really see it as that bad, but I guess that's all subjective. -Pat - Original Message - From: Hani Suleiman [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, January 11, 2003 4:15 AM Subject: Re: [OS-webwork] Getting rid of thread locals Err, how is ThreadLocal servlet related? How would any of the context stuff work without it? On Saturday, January 11, 2003, at 03:56 AM, Patrick Lightbody wrote: In effort to ditch the servlet paradigm, any thoughts on changing ActionContext from being a ThreadLocal to just a normal Map? I've got some code I can commit to CVS if you'd like to see how it would work. -Pat --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork
Re: [OS-webwork] Getting rid of thread locals
On Sat, Jan 11, 2003 at 08:11:26AM -0800, Patrick Lightbody wrote: ThreadLocal implies that you always have a single thread throughout the lifecycle of the action (prepare, execute, print results). This is true for a servlet container (single thread/request), but not so in other areas. Can you please tell of any other case? I think it's not to bad to constrain the execution environment of an action the be a single thread. The sequence of execution is sth. like Client-Dispatcher-Action, so the real constraint would be that the Dispatcher ensures this. If you look at the code, the context Map is being passed around. I don't really see it as that bad, but I guess that's all subjective. The usage of ThreadLocals is two edged sword. On the one hand, Thread locals avoid to pass a context all around, but on the other hand, it takes some time to understand how to use them. However this would actually only affect XWork developer, not the users of XWork. IMHO Passing a context is no pain either because this could always done in the constructor of the Action, View or anything because theese are used only once in webwork. So this is a matter of taste. Personally I would vote for not using ThreadLocals, where possible. -billy. -- Meisterbohne Söflinger Straße 100 Tel: +49-731-399 499-0 eLösungen 89077 Ulm Fax: +49-731-399 499-9 msg01149/pgp0.pgp Description: PGP signature
Re: [OS-webwork] Getting rid of thread locals
Patrick Lightbody wrote: ThreadLocal implies that you always have a single thread throughout the lifecycle of the action (prepare, execute, print results). This is true for a servlet container (single thread/request), but not so in other areas. No, it doesn't imply that. If the execution chain is broken, then one simply takes the context and reuse it whenever the chain is restarted. /Rickard --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork
Re: [OS-webwork] Getting rid of thread locals
I know, it is possible to do this, but it's a bit more complicated, if only because the user's (developers, whatever) don't actually _see_ the backing map without opening up some stack method that provides access to the ThreadLocal. If we pass the context around, all that happens is that execute() - execute(Map context). Before anyone shoots this down, I really want you to look at the code that is in CVS. It's not that bad and it makes things much simpler -- which is a primary goal of XWork. I really think this new code is more powerful and much simpler than the existing WebWork core. If you check out the source (especially with DispatcherTest as well as deploy the war and access Foo.action -- same thing), you'll find that it's pretty appealing (IMHO). :) -Pat - Original Message - From: Rickard Öberg [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, January 11, 2003 10:15 AM Subject: Re: [OS-webwork] Getting rid of thread locals Patrick Lightbody wrote: ThreadLocal implies that you always have a single thread throughout the lifecycle of the action (prepare, execute, print results). This is true for a servlet container (single thread/request), but not so in other areas. No, it doesn't imply that. If the execution chain is broken, then one simply takes the context and reuse it whenever the chain is restarted. /Rickard --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork --- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com ___ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork