This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Re: multiple top-level environments (one per ServletContext)
- To: Per Bothner <per at bothner dot com>, kawa at sources dot redhat dot com
- Subject: Re: multiple top-level environments (one per ServletContext)
- From: David Chase <chase at world dot std dot com>
- Date: Thu, 29 Mar 2001 20:21:14 -0500
- References: <E14huyk-0005AM-00@softdev><E14huyk-0005AM-00@softdev>
At 08:21 PM 3/28/2001 -0800, Per Bothner wrote:
>Well, we need some way to find the "current" top-level environment.
>You don't want to do that globally, which leaves two alternatives:
>(1) per-thread, which means having some kind of thread-to-Environment
>mapping.
>
>The current approach is (1). It can be generalized to arbitrary Threads,
>not just sub-classes of Future, presumably by using some kind of hash
>table. There are performance costs to this, plus there may be some
>resorce reclaimation issues (you want to remove the thread entry from
>the table when the tread dies). Using an interface instead of Future
>may be reasonable, but it doesn't change the general idea.
Couldn't you use java.lang.ThreadLocal?
David Chase
chase@naturalbridge.com