Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using JNDI for environment variables

 
Richard Robbins
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
Thanks,
Richard
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic