directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phil Steitz (JIRA)" <>
Subject [jira] Created: (DIRNAMING-16) Support links in XmlConfigurator
Date Sun, 27 Mar 2005 19:58:15 GMT
Support links in XmlConfigurator

         Key: DIRNAMING-16
     Project: Directory Naming
        Type: Improvement
    Reporter: Phil Steitz
 Assigned to: Phil Steitz 

Modify the XmlConfigurator to support links.  Logically, this will provide functionality similar
to, but significantly extending, the "global naming resources" provided by tomcat.

The idea is to enable links to other in-memory or external LDAP-backed contexts in XmlConfiguration
documents, as in the example below:

  <context name="global">
    <resource name="jdbc/pool" type="javax.sql.DataSource">
  <context name="app1" base="java:comp/env">
    <environment name="port" value="5555" type="java.lang.Integer" />
    <link name="datasource" context="global" rname="jdbc/pool" />

Hashtable env = new Hashtable();
env.put(NamingContext.NAME, "app1");
Context ctx = new InitialContext(env);
Context env = (Context) ctx.lookup("java:comp/env);
Integer port = (Integer) env.lookup("port");
DataSource ds = (DataSource) env.lookup("datasource"); //follows link

Similarly, an external LDAP context could be referenced, with federation transparent to the
client app:

  <context name="persistent" url="ldap://" />
    <link name="config/host" context="persistent" rname="config/host" />
    <link name="config" context="persistent" rname="config" />

Context ctx = new InitialContext();
Context env = (Context) ctx.lookup("java:comp/env);
String host = (String) env.lookup("config/host");

To support this, store jndi LinkRefs with jndi url names to represent the links. 

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
If you want more information on JIRA, or have a bug to report see:

View raw message