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, wait
enabledSmartExternalizableWithReference
public UIDLease()
public String getUID()
LeaseContext
getUID
in interface LeaseContext<Object>
public int getVersion()
LeaseContext
getVersion
in interface LeaseContext<Object>
public Object getObject()
LeaseContext
WriteModifiers.RETURN_PREV_ON_UPDATE
is used, otherwise null)getObject
in interface LeaseContext<Object>
public long getExpiration()
Lease
long
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 Lease
long
that indicates the time that the lease will expirepublic void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
public void cancel() throws UnknownLeaseException, RemoteException
Lease
cancel
in interface Lease
UnknownLeaseException
- the lease being cancelled is unknown to the lease grantorRemoteException
public void renew(long l)
Lease
public void setSerialFormat(int i)
Lease
setSerialFormat
in interface Lease
i
- DURATION or ABSOLUTELease.getSerialFormat()
public int getSerialFormat()
Lease
getSerialFormat
in interface Lease
Lease.setSerialFormat(int)
public LeaseMap createLeaseMap(long l)
Lease
createLeaseMap
in interface Lease
l
- the duration to put into a Long and use as the value for the current lease in
the created LeaseMappublic boolean canBatch(Lease lease)
Lease
Copyright © GigaSpaces.