7.2. The Lease Object

A Lease object must implement the Lease interface, presented in its entirety in Figure 7.1, which contains a set of methods for dealing with leases. In discussing the interface, we will ignore a few constants and methods that are not typically used in space-based programming; the full details of leasing can be found in the Jini™ Distributed Leasing Specification.

Figure 7.1. The Lease interface.
 package net.jini.lease; import java.rmi.RemoteException; public interface Lease { long FOREVER = Long.MAX_VALUE; long ANY = -1; int DURATION = 1; int ABSOLUTE = 2; long getExpiration(); void cancel() throws UnknownLeaseException, RemoteException; void renew(long duration) throws LeaseDeniedException, UnknownLeaseException, RemoteException; ...

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.