public class LockGuard extends Object
lockOwnerId
defines the owner of the lock. One example of the lock owner ID would be a transaction ID.
The guard has an expiration time defined during construction.Modifier and Type | Field and Description |
---|---|
static LockGuard |
NOT_LOCKED |
Constructor and Description |
---|
LockGuard(Address lockOwner,
String lockOwnerId,
long leaseTime) |
Modifier and Type | Method and Description |
---|---|
boolean |
allowsLock(String ownerId) |
boolean |
allowsUnlock(String ownerId) |
long |
getLockExpiryTime() |
Address |
getLockOwner() |
String |
getLockOwnerId() |
long |
getRemainingTime() |
boolean |
isLeaseExpired() |
boolean |
isLocked() |
String |
toString() |
public static final LockGuard NOT_LOCKED
public boolean isLocked()
public boolean isLeaseExpired()
public boolean allowsLock(String ownerId)
public boolean allowsUnlock(String ownerId)
public Address getLockOwner()
public String getLockOwnerId()
public long getLockExpiryTime()
public long getRemainingTime()
Copyright © 2020 Hazelcast, Inc.. All Rights Reserved.