wood burning stoves 2.0*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Unreferenced Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Unreferenced" Watch "Unreferenced" New topic
Author

Unreferenced

Holmes Wong
Ranch Hand

Joined: Feb 18, 2002
Posts: 163
Hi, ranchers:
I want to clean up stale clients, and also strictly stick to the requirements. As api says,
Connection object only needs to extends Unreferenced to do the job. Is that it? Do we need to do anything more to take care of this while not concerning about abnormal client crashes? Thanks.
BJ Grau
Ranch Hand

Joined: Jul 10, 2001
Posts: 234
Unless you decrease java.rmi.dgc.leaseValue and sun.rmi.dgc.checkInterval the time it takes for Unreferenced.unreferenced() to be called for a remote object being referenced by an abnormally crashed client will be 15 minutes (I think). I think this is too long to be acceptable in a production application. If you shorten them too much, you will create extra network traffic that may affect performance.
I remember Sai suggested writing a thread that periodically checks for abnormally crashed clients.
I have also seen folks get high scores without accounting for abnormally crashed clients.
Personally, I don't think I'm going to do anything besides Unreferneced. If I am asked about it I will explain that the requirements don't call for it, and I am deferring it to release 1.x. Do you whatever you want, but just have a good reason for it and you will be fine.
Sai Prasad
Ranch Hand

Joined: Feb 25, 2002
Posts: 560
Implementing Unreferenced is enough for this assignment as long as are willing to reduce the lease time to reasonable value.
I had a cleanup thread in addition to Unreferenced which wakes up every 30 seconds to release the unused locks.
Holmes Wong
Ranch Hand

Joined: Feb 18, 2002
Posts: 163
Thanks, BJ and Sai for your valuable feedback.
 
 
subject: Unreferenced
 
Similar Threads
Unreferenced Interface,
confusion
FBNS: Question about Unreferenced Example by Mr. Monkhouse
How could the RMI server get to know client crashed?
leaseValue