commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jung, Eric" <>
Subject [Configuration] why is JNDIConfiguration.getContext() private?
Date Mon, 20 Sep 2004 14:42:57 GMT

Firstly, I love Configuration and have been using it in multiple projects at
multiple jobs for quite some time now. But my current project is a
stand-alone java application (i.e., no application container, not web-based)
that runs on desktops, not servers.

I'd like to use JNDIConfiguration to retrieve configuration values from a
remote JNDI repository. However, I can't find a way to configure
JNDIConfiguration to communicate with a remote repository. Since I can't
rely on, I need a programmatic way to point
JNDIConfiguration to remote repository. For example, I need to execute this
kind of code:

  Hashtable env = new Hashtable();
  env.put("com.sonicsw.jndi.mfcontext.domain", domain);
  env.put(Context.PROVIDER_URL, address);
  env.put(Context.SECURITY_PRINCIPAL, username);
  env.put(Context.SECURITY_CREDENTIALS, password);
  InitialContext ret = new InitialContext(env);

One way to do this is for me to override JNDIConfiguration.getContext(), but
it is currently a private method. Another way might be to create a class
member hashtable that users of JNDIConfiguration (like me) can set
appropriately, and have JNDIConfiguration.getContext() use this hashtable to
create the initial context if it's non-null. I'm sure there are a host of
other ways, also, to achieve the same thing.

Anyway, in the meantime, I've had to write my own JNDIConfiguration
extending AbstractConfiguration, which I'd really like to throw away!

Are there any plans to expose this kind of behavior with JNDIConfiguration?

Thank you in advance,
Eric Jung

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message