Jerikc XIONG
Jerikc XIONG

Reputation: 3607

Is it possible to share a object between multiple processes in Java ?

I have a class MyClass with a open() and release() method.

process1 invoke the open(), and if process2 startup , the release() should be invoked in process1 firstly and then invoke the open()

PS: process1 and process2 are two different process.

How to do it ?

Upvotes: 0

Views: 82

Answers (1)

user207421
user207421

Reputation: 310875

Yes. You can export a remote object from a JVM and call its methods remotely from another JVM process or indeed another host. This is called Remote Method Invocation (RMI).

Upvotes: 1

Related Questions