directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phil Steitz" <p...@steitz.com>
Subject RE: [naming] ResourceLinks
Date Wed, 12 Jan 2005 19:06:52 GMT
Roland,
 
Thanks for the feedback and volunteering to help.  Your suggestions below look good and I
will work with you to get patches applied, etc.  In response to your question about why the
java:comp/env initial context is stomped when a name attribute is found, that is an ugly hack
that I inserted to allow support for contexts other than java:comp/env.  I left the default
to java:comp/env to make it backward compatible for applications that used the original implementation.
 It is on my todo list to refactor the code to eliminate the hack.  Please feel free to beat
me to it :-)  The nested contexts in the dtd are currently not supported.  Any ideas on how
/ exactly what to implement there would be welcome.   I think that extending the dtd to allow
support for resource links and cleaning up the context root declaration and implementation
would be great.   We should be able to do this in a backward compatible way IIUC, by making
the presence of the name attribute determine whether or not the context created is rooted
at the default java:comp/env, allowing an empty name for "global context" or using a global
attribute as you describe below.
 
Phil

-----Original Message----- 
From: BERGER ROLAND [mailto:R.BERGER@sbb.ch] 
Sent: Wed 1/12/2005 8:37 AM 
To: Phil Steitz; directory-dev@incubator.apache.org 
Cc: 
Subject: Re: [naming] ResourceLinks

-- Erhalten von  SYSUEXT.UE05588 +41 51 220 49 56           12.01.05 16.37

Hi Phil

Thank's for your repliy. First I give you some explanations what we are doing
and then what we would like to have:

We have developed a framework similar to Hivemind. In our application code we
have jndi lookups to java:comp/env but also to the 'global' context.

ctx.lookup("java:comp/env/...");
ctx.lookup("...");

To make our code work with out modification in a J2SE Environment, where no
JNDI implementaion is available from an App Server, we need to be able to
bind names to the global/initial context and also to some other contexts like
java:comp/env. We also need to have references (resourcelink) pointing to
'global' resources.

Since it looks like I have some time to spend on that I would like to provide
patches. Here are my thoughts:

- To enable resourcelinks I propose to change the naming.dtd ( see below).
Only the class ResourceLinkFactory from Tomcat sources must be added AFAIK
and some coding to make it work is necessary.

- To be able to store resources to the global context a way must be found to
identify which context of all the contexts in naming.xml is/are the global
one. Since the context without a name attribut is associated with
java:comp/env I propose to indicate the global one with a flag in the context
element. <context global="true">. The name attribute would then be ignored.

I can implement a solution and submit it to you. If you like it, commit it
otherwise drop it.

WDYT?

Question:

More than one context element is allowed in naming.xml. Why is
XMLConfigurator destroying the previous initial context when a context
element, having a name attribute, is found? This way all previous created
contexts are lost. Is this a bug or a feature? Can you explain me the scenes
behind!?

                 

Mime
View raw message