Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

RMI Lease

 
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
There is still one point on RMI that I am unclear on: What happens when a lease expires on an remote object while a live client holds an active reference to that object?
The API docs says that a client should call DGC.dirty() to renew the lease. How is that accomplished or does it just happen through the stub?
One further question: How does the client know what the lease duration is?
Thanks in advance
Michael Morris
 
author
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Michael Morris:
There is still one point on RMI that I am unclear on: What happens when a lease expires on an remote object while a live client holds an active reference to that object? [...] How does the client know what the lease duration is?

The lease is not allowed to expire unless the client has crashed or the network connection between client and server is severed. If this happens, the server-side skeleton and object will be cleaned up and next time the client calls the object an RMIException will be thrown.
You don't need to call DGC.dirty(). This is taken care of by the RMI implementaton.
The lease duration is contained in the Lease object returned by DGC.dirty(). Off the top of my head I can't remember a way for application-level code to determine the lease duration. On a protocol level the server does communicate the lease duration to the client so the client knows when to renew it, but that's firmly under the hood.
Ultimately these are RMI implementation details that should be of no concern to a humble developer, I'd think.
- Peter
[ April 17, 2002: Message edited by: Peter den Haan ]
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Peter. I'll fret no longer on the subject.
Michael Morris
 
To do a great right, do a little wrong - shakepeare. twisted little ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic