• 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
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

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
 
You guys wanna see my fabulous new place? Or do you wanna look at this tiny ad?
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!