Win a copy of Svelte and Sapper in Action this week in the JavaScript 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
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

DGC.dirty() and Lease

 
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
The javadoc for DGC.dirty() states the following:

The client must also make a dirty call to renew leases on remote references before such leases expire. When the client no longer has any references to a specific remote object, it must schedule a clean call for the object ID associated with the reference.

How does one insure that the lease does not expire on a remote reference before the client is ready to relinquish it? How does one acquire a DGC reference on a remote VM in order to check the lease information? The API docs on java.rmi.dgc are not very helpful on these subjects and despite many futile searches, I am no closer to understanding them.
Thanks in advance for your help
Michael Morris
SCJP2
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Michael Morris:
Hi All,
The javadoc for DGC.dirty() states the following:

The client must also make a dirty call to renew leases on remote references before such leases expire. When the client no longer has any references to a specific remote object, it must schedule a clean call for the object ID associated with the reference.

How does one insure that the lease does not expire on a remote reference before the client is ready to relinquish it? How does one acquire a DGC reference on a remote VM in order to check the lease information? The API docs on java.rmi.dgc are not very helpful on these subjects and despite many futile searches, I am no closer to understanding them.
Thanks in advance for your help
Michael Morris
SCJP2


One does not need to worry lease expiration from a clients perspective. If a client has a reference to a remote object then DGC lease renewal happens automatically. There is no need to renew the lease yourself. To get rid of an object simply drop your reference to the remote object. When the stub object is GC'ed then the renewal of the lease will cease, and the remote object will be GC'ed itself. (That is provided no other clients have a reference to that remote object--remember--RMI Registry counts as one).
charlie
 
I like you because you always keep good, crunchy cereal in your pantry. This tiny ad agrees:
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