7.4. Automated Lease Renewal
Often a lease or a set of leases needs to be renewed repeatedly, either because you don't know a priori how long you'll need a particular resource, or because a space may not be willing to grant you a resource for the entire time you request. You can deal with both cases by requesting a lease for some initial length of time and then continually renewing the lease until you're finished with the resource.
This process can be automated by using a lease renewal manager. A lease renewal manager administers one or more leases, renewing them as necessary up to some specified stopping time. The lease manager pattern is common enough that the com.sun.jini.lease.LeaseRenewalManager class provides an implementation. In the remainder ...
Get JavaSpaces™ Principles, Patterns, and Practice now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.