users@glassfish.java.net

Foreign JNDI / ExternalContext for Glassfish

From: Christian Schuhegger <Christian.Schuhegger_at_gmx.de>
Date: Wed, 01 Oct 2008 16:11:46 +0200

Hello,

I've read in the weblogic documentation that weblogic supports a feature
called Foreign JNDI:
http://download.oracle.com/docs/cd/E11035_01/wls100/jndi/jndi.html#wp477172

Similar JBoss supports an ExternalContext:
http://www.redhat.com/docs/manuals/jboss/jboss-eap-4.2/doc/Server_Configuration_Guide/Additional_Naming_MBeans-org.jboss.naming.ExternalContext_MBean.html

The feature can be used to bind a JNDI remote context into the local
JNDI tree. I was wondering if some similar feature exists in GlassFish
or if there exists some "standard" way on how to achieve such functionality?

My use case would be that I have a server called front-end that hosts
the web application (.war deployment) and a server called back-end that
hosts the business logic implemented as EJBs (.ear deployment). Now I
can create in the front-end an initial context with the connection
settings to connect to the back-end and use this initial context to
locate my services, but if the name of the back-end server would change
or the IP address or if suddenly the back-end would not be a single
machine, but several in a cluster (e.g. a HA JNDI implementation like
http://wiki.jboss.org/wiki/JBossHAJNDIImpl) then I would have to change
settings in my front-end application. It would be cleaner to just
configure foreign JNDI context to sit at a certain node of the local
JNDI context.

Thanks for any answers or comments,
-- 
Christian Schuhegger
http://www.el-chef.de/