This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes Multi Process Configuration Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Multi Process Configuration" Watch "Multi Process Configuration" New topic
Author

Multi Process Configuration

Yair Ogen
Greenhorn

Joined: Feb 12, 2003
Posts: 29
Hi,

I have a product built out of multiple processes. Each process uses internally commons configuration.

Does anyone have an idea how to manage the config? I.e. we do not want to duplicate variables so each process will be able to read them.

Additionally, DB solution is no good, as we do not want to be dependent on DB for something like configuration.

Thanks

Yair


Regards,<br /> <br />Yair Ogen
Matt Cartwright
Ranch Hand

Joined: Aug 25, 2008
Posts: 149

Yair Ogen wrote:Hi,

I have a product built out of multiple processes. Each process uses internally commons configuration.


"multiple processes" as in "multiple instances of JVM" hosted in one instance of OS?

or multiple threads?
as in "multiple tasks (executions paths) in the same instance of JVM"?

Just trying to figure
M
Yair Ogen
Greenhorn

Joined: Feb 12, 2003
Posts: 29
Multiple JVM's.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12759
    
    5
A commonly available XML configuration file or Properties file is a typical solution.

How does data move between the processes?

Bill
Matt Cartwright
Ranch Hand

Joined: Aug 25, 2008
Posts: 149


The way I understand your question is, you are looking for dynamic
configuration updates (at runtime without having to restart the app).

If all JVMs are running on the same hos,t Inter Process Communication (IPC)
could be the way to share variables between processes.

In Java you could be using java.nio.MappedByteBuffer.
Well, synchronization is another thing to do then.

Or maybe you wanna have a look into JINI which
also supports a distributed approach (JVMs running on different machines).

Hope that helps
Matt




Yair Ogen
Greenhorn

Joined: Feb 12, 2003
Posts: 29
Can you please elaborate more on IPC?
Matt Cartwright
Ranch Hand

Joined: Aug 25, 2008
Posts: 149

The main IPC facilities are

  • message queues
  • semaphores
  • shared memory


  • and have been introduced in AT&T's System V.

    There also are BSD IPC facilities which are mainly socket based.

    Maybe you can have a read here
    and in particular here.

    Hope that helps
    Matt
    Yair Ogen
    Greenhorn

    Joined: Feb 12, 2003
    Posts: 29
    Thanks, So you think that if one has multiple processes on multiple VM's and he wishes to have a centralized Configuration (to avoid duplicate entries etc), the way to go is via IPC?

    Not a bit of an over kill?

    Specifically, we are using commons-configuration. anyone know if they have any solution for such a problem?

    Thanks.
    Matt Cartwright
    Ranch Hand

    Joined: Aug 25, 2008
    Posts: 149

    Yair Ogen wrote:Thanks, So you think that if one has multiple processes on multiple VM's and he wishes to have a centralized Configuration (to avoid duplicate entries etc), the way to go is via IPC?


    That's the only way I know when it comes to sharing data between processes and you are not using a database or files.

    For Java you could also use Java Spaces (e.g. Apache River).

    I am not saying this is the holy grail, just the world from my point of view having worked with TP Monitors in IPC
    environments for more than 15 years



     
    With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
     
    subject: Multi Process Configuration
     
    Similar Threads
    Issue with JBoss restart
    Collect Servlet and JSP invocation stats in Tomcat
    Jar File Rephrased A Bit
    Uploading 4000 records in 1 minute
    2 databases access with EJB ?