public abstract class AbstractLease extends Object implements Lease, Serializable
| Modifier and Type | Field and Description |
|---|---|
protected long |
expiration
The lease expiration, in local absolute time.
|
protected int |
serialFormat
Serialization format for the expiration.
|
| Modifier | Constructor and Description |
|---|---|
|
AbstractLease(AtomicSerial.GetArg arg) |
protected |
AbstractLease(long expiration)
Construct a relative-format lease.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract long |
doRenew(long duration)
Renew the lease for a duration relative to now, and return
the duration actually granted.
|
long |
getExpiration()
Return the lease expiration.
|
int |
getSerialFormat()
Return the serialization format for the expiration.
|
void |
renew(long duration)
Renew the lease for a duration relative to now.
|
void |
setSerialFormat(int format)
Set the serialization format for the expiration.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcanBatch, cancel, createLeaseMapprotected transient volatile long expiration
protected volatile int serialFormat
public AbstractLease(AtomicSerial.GetArg arg) throws IOException
arg - IOExceptionAtomicSerialprotected AbstractLease(long expiration)
public long getExpiration()
getExpiration in interface Leasepublic int getSerialFormat()
getSerialFormat in interface Leasepublic void setSerialFormat(int format)
setSerialFormat in interface Leasepublic void renew(long duration)
throws UnknownLeaseException,
LeaseDeniedException,
RemoteException
renew in interface LeaseUnknownLeaseExceptionLeaseDeniedExceptionRemoteExceptionprotected abstract long doRenew(long duration)
throws UnknownLeaseException,
LeaseDeniedException,
RemoteException
Copyright © 2016–2018. All rights reserved.