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] Another memory jndi impl
Date Fri, 28 Nov 2003 05:24:23 GMT
Brett Porter wrote:
>  > I was in the process of repackaging the commons naming code for
>  > inclusion in the Directory project.  I will have a look at the Avalon
>  > stuff, but if its OK with everyone, I would prefer to get the commons
>  > code into Subversion (under /naming) ASAP.  I should have the
>  > repackaging (maybe a little refactoring) and some more tests
>  > done this
>  > weekend some time. I know that Brett has been working on XML config.
> 
> Nothing fancy, it just uses digester to parse a Tomcat-like config file 
> to configure resources and environment entries. Still needs some work.

Nice!  Somehow I missed the commit to commons-naming that added the 
XMLConfigurator.

I even got this to work to configure a mail session:

<resource name="mail/Session" type="javax.mail.Session">
   <parameter>
     <name>mail.smtp.host</name>
     <value>localhost</value>
   </parameter>
</resource>
...
initCtx = new InitialContext();
envCtx = (Context) initCtx.lookup("java:comp/env");
session = (Session) envCtx.lookup("mail/Session");

We can talk about how to improve/generalize this, but it actually looks 
quite useful as is. I now see why at least this implementation belongs in 
the factory subproject and I think that it is good idea to keep it simple 
(as it is), for convenience in configuring JNDI resources.  Extending it 
to handle nested contexts (as noted) and more general sorts of bindings is 
an obvious next step.

Phil

> 
> Cheers,
> Brett
> 




Mime
View raw message