public static class LeaseInitializer.UIDLease extends Object implements LeaseContext<Object>, SmartExternalizable
| Constructor and Description |
|---|
UIDLease()
default no-args public constructor for Externalizable impl
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canBatch(Lease lease)
Returns a boolean indicating whether or not the lease given as a parameter can be batched
(placed in the same LeaseMap) with the current lease.
|
void |
cancel()
Used by the lease holder to indicate that it is no longer interested in the resource or
information held by the lease.
|
LeaseMap |
createLeaseMap(long l)
Creates a Map object that can contain leases whose renewal or cancellation can be batched,
and adds the current lease to that map.
|
long |
getExpiration()
Returns a
long that indicates the time that the lease will expire. |
Object |
getObject()
returns the previous value associated with this update-or-write operation.
|
int |
getSerialFormat()
Returns the format that will be used to serialize the lease.
|
String |
getUID()
Returns UID of written Entry.
|
int |
getVersion()
Returns the version of written \ updated entry.
|
void |
readExternal(ObjectInput in) |
void |
renew(long l)
Used to renew a lease for an additional period of time, specified in milliseconds.
|
void |
setSerialFormat(int i)
Sets the format to use when serializing the lease.
|
void |
writeExternal(ObjectOutput out) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitenabledSmartExternalizableWithReferencepublic UIDLease()
public String getUID()
LeaseContextgetUID in interface LeaseContext<Object>public int getVersion()
LeaseContextgetVersion in interface LeaseContext<Object>public Object getObject()
LeaseContextWriteModifiers.RETURN_PREV_ON_UPDATE is used, otherwise null)getObject in interface LeaseContext<Object>public long getExpiration()
Leaselong that indicates the time that the lease will expire. This time is
represented as milliseconds from the beginning of the epoch, relative to the local clock.getExpiration in interface Leaselong that indicates the time that the lease will expirepublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundExceptionpublic void cancel()
throws UnknownLeaseException,
RemoteException
Leasecancel in interface LeaseUnknownLeaseException - the lease being cancelled is unknown to the lease grantorRemoteExceptionpublic void renew(long l)
Leasepublic void setSerialFormat(int i)
LeasesetSerialFormat in interface Leasei - DURATION or ABSOLUTELease.getSerialFormat()public int getSerialFormat()
LeasegetSerialFormat in interface LeaseLease.setSerialFormat(int)public LeaseMap createLeaseMap(long l)
LeasecreateLeaseMap in interface Leasel - the duration to put into a Long and use as the value for the current lease in
the created LeaseMappublic boolean canBatch(Lease lease)
LeaseCopyright © GigaSpaces.