Constructor and Description |
---|
DurableNotificationLease(ReplicationNotificationClientEndpoint replicationNotificationClientEndpoint,
long lease,
EventSessionConfig sessionConfig,
IAsyncHandlerProvider asyncProvider) |
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 duration)
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. |
org.slf4j.Logger |
getLogger() |
int |
getSerialFormat()
Returns the format that will be used to serialize the lease.
|
void |
renew(long duration)
Used to renew a lease for an additional period of time, specified in milliseconds.
|
void |
setSerialFormat(int format)
Sets the format to use when serializing the lease.
|
void |
startLeaseReaperIfNecessary() |
public DurableNotificationLease(ReplicationNotificationClientEndpoint replicationNotificationClientEndpoint, long lease, EventSessionConfig sessionConfig, IAsyncHandlerProvider asyncProvider)
public org.slf4j.Logger getLogger()
public void startLeaseReaperIfNecessary()
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 cancel()
Lease
public void renew(long duration) throws LeaseDeniedException, UnknownLeaseException, RemoteException
Lease
renew
in interface Lease
duration
- the requested duration in millisecondsLeaseDeniedException
- the lease grantor is unable or unwilling to renew the leaseUnknownLeaseException
- the lease being renewed is unknown to the lease grantorRemoteException
public void setSerialFormat(int format)
Lease
setSerialFormat
in interface Lease
format
- DURATION or ABSOLUTELease.getSerialFormat()
public int getSerialFormat()
Lease
getSerialFormat
in interface Lease
Lease.setSerialFormat(int)
public LeaseMap createLeaseMap(long duration)
Lease
createLeaseMap
in interface Lease
duration
- 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.