public class LandlordLease extends AbstractLease implements ReferentUuid, ID<Uuid>, ProxyAccessor
net.jini.core.lease.Lease that works
with the the Landlord protocol.Landlord,
Serialized Formexpiration, serialFormat| Constructor and Description |
|---|
LandlordLease(Uuid cookie,
Landlord landlord,
Uuid landlordUuid,
long expiration)
Create a new
LandlordLease. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canBatch(Lease lease) |
void |
cancel() |
LeaseMap<? extends Lease,Long> |
createLeaseMap(long duration) |
protected long |
doRenew(long renewDuration)
Renew the lease for a duration relative to now, and return
the duration actually granted.
|
boolean |
equals(Object other) |
Object |
getProxy() |
Uuid |
getReferentUuid() |
int |
hashCode() |
Uuid |
identity() |
String |
toString() |
getExpiration, getSerialFormat, renew, setSerialFormatpublic LandlordLease(Uuid cookie, Landlord landlord, Uuid landlordUuid, long expiration)
LandlordLease.cookie - a Uuid that universally and uniquely
identifies the lease this object is to be a proxy forlandlord - Landlord object that will be used to
communicate renew and cancel requests to the granter
of the leaselandlordUuid - a universally unique id that has been
assigned to the server granting of the lease.
Ideally the Uuid landlord.getUuid would
return if landlord implemented
ReferentUuid. Used to determine when
two leases can be batched together.expiration - the initial expiration time of the lease in
milliseconds since the beginning of the epochNullPointerException - if landlord,
landlordUuid or cookie
is nullpublic void cancel()
throws UnknownLeaseException,
RemoteException
cancel in interface LeaseUnknownLeaseExceptionRemoteExceptionprotected long doRenew(long renewDuration)
throws LeaseDeniedException,
UnknownLeaseException,
RemoteException
AbstractLeasedoRenew in class AbstractLeaseLeaseDeniedExceptionUnknownLeaseExceptionRemoteExceptionpublic Uuid getReferentUuid()
getReferentUuid in interface ReferentUuidpublic LeaseMap<? extends Lease,Long> createLeaseMap(long duration)
createLeaseMap in interface Leasepublic Uuid identity()
public Object getProxy()
getProxy in interface ProxyAccessorCopyright © 2016–2018. All rights reserved.