File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes Using JNDI for environment variables Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Using JNDI for environment variables" Watch "Using JNDI for environment variables" New topic

Using JNDI for environment variables

Richard Robbins
Ranch Hand

Joined: Mar 07, 2001
Posts: 66
I am developing an application for Windows that involves using several processes on different machines communicating via sockets. Each process on each machine needs to know what hosts/ports are available for communication. I don't want to be tied to a database (querying for available host info), I don't want to use a configuration file, and I don't want to be tied to the Windows registry. Is there a possibility using JNDI to (upon install) configure an environment variable that will hold the information concerning what hosts and ports are available for connecting? If so, please explain. I am new to JNDI.

Richard Robbins is one of the founders of, a resource for free website templates and Photoshop tutorials. He also consults for an online boutique selling baptism dresses and christening gowns.
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

How about using JMS?

You can make a topic (available hosts), that each part of your application would subscribe to.

As new hosts come on, they publish their info to this topic, and you can remove this info in a similar manner.
I agree. Here's the link:
subject: Using JNDI for environment variables
It's not a secret anymore!