geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan <>
Subject Legacy JNDI support ?
Date Thu, 27 Jun 2013 07:23:14 GMT

One tradition usage for JNDI API is that, the users could configure a
factory class while creating the Context instance, and the jar file
contains the context factory is shipped in the user application.

Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.myContextFactory");
InitialContext ctx = new InitialContext(env);

While moving to OSGi, the typical scenario above will not work, as the
current JNDI lookup follows the JNDI OSGi spec, except that the configured
factory could be loaded from JRE, we will always return the default XBean

I could saw two solutions for this,

a. Enable the leagacy JNDI support from Aries

b. Add the similar logic in our DefaultInitialContextFactoryBuilder.

I would prefer the option b, considering the logic is so simple, and there
is no need to import another  jar file, also, we may not suffer the
potential ordering issue, since the current
DefaultInitialContextFactoryBuilder will always return one context instance.

Thoughts ?


View raw message