• Post Reply Bookmark Topic Watch Topic
  • New Topic

System.setProperty across VMs  RSS feed

 
Manish Hatwalne
Ranch Hand
Posts: 2596
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
System.setProperty across JVMs

A basic question maybe, but I am a bit confised about this one and hence thought that I should ask for more information.

In my code if I use System.setProperty(property, value) will this system propery be availbale to other program running in separate JVMs while this code is running? My sample code suggested that it won't be, and I am hoping that it would be consistent over other platforms and or JVMs by other vendors.



I do not want to use files either, what can I do to make sure that I make a certain property available to all other programs running in other VMs as long as thsi particular program is running.

BTW, I know abou singleton pattern etc, and that is not what I am loking for.

I need to set a property for the entire running duration of a program so that the property is readable by any other program running in other VMs and once tsi program is finished, the property should vanish. Any other suggestion besides files/databse etc?

TIA,
- Manish
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is normally done with locks (semaphores).
You find a solution in java.nio.channels.FileLock.

Why do you want to avoid Files?
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!