Jean Gauthier
Jean Gauthier

Reputation: 265

RMI: check client crash

I am programming a simple client/server application using Java-RMI. I would like to know when all clients died, in order to shut the server down. After having done some research on the web, I found out that I could make my server implement the Unreferenced interface and define the unreferenced() method. But this seems not to work, and I think it is because the server is bound to the RMI-Registry, which probably holds a reference on it.

Does anybody have an idea of how I could get notified when all clients crashed in my case?

Thanks

Upvotes: 2

Views: 703

Answers (1)

user207421
user207421

Reputation: 311039

I think it is because the server is bound to the RMI-Registry, which probably holds a reference on it.

You are correct, the RMIRegistry also counts as a client for DGC/Unreferenced purposes.

Upvotes: 3

Related Questions