File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Distributed Java and the fly likes How to use Unreferenced in RMI? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "How to use Unreferenced in RMI?" Watch "How to use Unreferenced in RMI?" New topic

How to use Unreferenced in RMI?

Zhixiong Pan
Ranch Hand

Joined: Jan 25, 2006
Posts: 239
Hi ranchers,
My motivation comes from a problem in designing server-clients.If my client suddenly shut down while connecting server, my server need to get some information from such client.Should i use Unreferenced interface or some other classes?And how to use?

Edward Harned
Ranch Hand

Joined: Sep 19, 2005
Posts: 291

Unreferenced is only called when no client has a reference to the server. If you use the RMIRegistry, then it has a reference and Unreferenced is never called.

Your concern has been the concern of developers since the beginning of remote procedures. There have been numerous discussions on this subject on the RMI forum at It all comes down to personal preferences.

My personal preference is: So What! I�m a Server. I�m here to service requests from remote clients. Because no clients call me for n-minutes, So What. If this is a big concern, then look into Activation. You can deactivate your server in times of no activity and reestablish it when next a client calls.

Ed's latest article: A Java Reactive Generator
I agree. Here's the link:
subject: How to use Unreferenced in RMI?
It's not a secret anymore!