June 1999
Intermediate to advanced
368 pages
8h 21m
English
When we call write, we supply a lease parameter that specifies the amount of time we'd like the space to store the entry. Recall the signature of the write method, which we discussed in Chapter 2:
Lease write(Entry e, Transaction txn, long lease) throws RemoteException, TransactionException;
The write method returns a Lease object that contains the actual lease time the entry was granted—the space may grant the full time requested, or a reduced time. In either case, when the lease time expires, the space will remove the entry from the space. If the space is unable to grant a lease at all, the write method will throw a RemoteException.
So far in this book, we've been supplying Lease.FOREVER as the lease time, which requests ...
Read now
Unlock full access