• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

DGC.dirty() and Lease

 
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Think of how dumb the average person is. Mathematically, half of them are EVEN DUMBER. Smart tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic