File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Unreferenced question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Unreferenced question" Watch "Unreferenced question" New topic

Unreferenced question

Aruna Raghavan
Ranch Hand

Joined: May 14, 2002
Posts: 194
I am trying to extend Unreferenced in my Server code to get notified when all the clients go away. I would like to get this on my ConnectionImpl which handles all the details for a single client connection. I read in JGURU that unreferenced() will not get called if the Server is registered with the RMI registry. I register the ConnectionFactoryimpl with the registry, not the ConnectionImpl. When I tried to implement unreferenced() on connectionImpl, it did not get called when the corresponding client went away.
Did anyone get this to work successfully? Help

Aruna A. Raghavan<br />SCJP, SCJD, SCWCD
Aruna Raghavan
Ranch Hand

Joined: May 14, 2002
Posts: 194
I just read Daniela's "leasevalue' thread. I guess I didn't wait fot 15 min. for it to be called!
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

java.rmi.dgc.leaseValue (1.1 and later)
The value of this property represents the lease duration (in milliseconds) granted to other JVMs that hold remote references to objects which have been exported by this JVM. Clients usually renew a lease when it is 50% expired, so a very short value will increase network traffic and risk late renewals in exchange for reduced latency in calls to Unreferenced.unreferenced. The default value of this property is 600000 milliseconds (10 minutes).

This is what SUN write about the 'java.rmi.dgc.leaseValue' property

Regards, Rene Larsen
Dropbox Invite
Peter den Haan
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
It's good to give a hungry man a fish, but it's even better to give him a fishing hook You can find this in your JDK documentation: go to the Guide to Features heading, select Remote Method Invocation (RMI), then under the For More Information heading you'll find Useful java.rmi Properties.
- Peter
[ January 06, 2003: Message edited by: Peter den Haan ]
I agree. Here's the link:
subject: Unreferenced question
It's not a secret anymore!