For the web container, it is pretty simple to setup a threadlocal
on the way into a web application context.   However it is more tricky
if a servlet from one context dispatches to another context - as there
may not be suitable cut points to put in geronimo specific handling.

We can either changed the web containers to put in such cut points.
Or alternately, if your thread local contains a factory, then we could
put a webcontainer classloader aware factory there to select the
actual initial context.  That would allow different parts geronimo to
use different mechanisms for finding an initial context.

cheers



Jeremy Boynes wrote:
I have checked in a simple impl of JNDI for the java: namespace
(o.a.g.naming.java)

This is based on a couple of assumptions:
* that the comp Context for a component is immutable so can be heavily
indexed
* that the majority of lookups are for simple strings (e.g. "env/jdbc/MyDS")
* that we do not need to bind anything to the java: namespace except
java:comp/...

The component Context is taken from a ThreadLocal rather than the context
ClassLoader because for EJBs several components may share the same
classloader. For an EJB this is easy to set up in an Interceptor during
invocation. I am not sure how a Web Container can set this up yet (maybe in
a Valve or equivalent).

--
Jeremy







Reply via email to