How can a distributed shared object implement in Java? By Distributed Shared object I mean, the full object graph shared across multiple JVM in the same machine and also across different machines, for example.
Support I have this object:
Environment env = Environments.newInstance(dbPath, config);
environmentMap.put(dbPath, env);
Where dbPath
is a path to a mounted network file system (e.g. /mnt/db
). And I have 3 Linux machines running with such dbPath
mounted on it on the same mount point.
I need this env
object shared across different JVM and machines. Typically on a single JVM one strategy is to put this into a Singleton object and get the Environment
object from that singleton. However, that obviously would not work on separate JVM let alone JVM on different machines.
What is the best way to achieve this?