----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, November 07, 2000 6:50 AM
Subject: Re: Tomcat & JNDI


> > I have my own little in memory JNDI implementation with support for
> > java:comp URLs
> > and it works fine but provides one global JNDI for all contexts defined
in
> > server.xml while it should be context specific. Basically the problem is
how
> > to make InitialContext() tomcat context aware (to be precise to make my
> > java:comp namespace to start from different roots depending on where
> > InitialContext was created).
>
> One idea:
> 1. Create a custom Interceptor.
>
> 2. In preService and preInit, set a thread data object ( that can be
> accessed from your InitialContext) ( of course, your interceptor will be
> JDK1.2 specific )
>
> There are other ways to do it, the problem is how to pass a parameter (
> like the current context ) without passing it explicitely ( you don't have
> "ServletContext" params in your InitialContext constructor ). The best way
> you can do that is associating the object with the Thread ( since
> getThread() is so easy to do ).
>
> If you want JDK1.1 compat you could use a static Hashtable, keyed by
> Thread and having as value the information you need ( current context ).

All the helper classes which handle the associtations are within the
org.apache.naming package, so your interceptor should be trivial to write.

> Please contribute the result back to tomcat :-)

Tyrex also includes such an interceptor.

Remy


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to