public class ClientLockProxy extends ClientProxy implements ILock
| Constructor and Description |
|---|
ClientLockProxy(String serviceName,
String objectId) |
| Modifier and Type | Method and Description |
|---|---|
void |
forceUnlock()
Releases the lock regardless of the lock owner.
|
Object |
getKey()
Deprecated.
|
int |
getLockCount()
Returns re-entrant lock hold count, regardless of lock ownership.
|
long |
getRemainingLeaseTime()
Returns remaining lease time in milliseconds.
|
protected <T> T |
invoke(ClientRequest req) |
boolean |
isLocked()
Returns whether this lock is locked or not.
|
boolean |
isLockedByCurrentThread()
Returns whether this lock is locked by current thread or not.
|
void |
lock() |
void |
lock(long leaseTime,
TimeUnit timeUnit)
Acquires the lock for the specified lease time.
|
void |
lockInterruptibly() |
Condition |
newCondition()
This method is not implemented! Use
ILock.newCondition(String) instead. |
ICondition |
newCondition(String name)
Returns a new
ICondition instance that is bound to this
ILock instance with given name. |
String |
toString() |
boolean |
tryLock() |
boolean |
tryLock(long time,
TimeUnit unit) |
void |
unlock()
Releases the lock.
|
destroy, equals, getClient, getContext, getId, getName, getPartitionKey, getServiceName, hashCode, invoke, invoke, invokeInterruptibly, invokeOnPartition, listen, listen, onDestroy, onInitialize, onShutdown, setContext, stopListening, throwExceptionIfNull, toData, toObjectclone, finalize, getClass, notify, notifyAll, wait, wait, waitdestroy, getId, getName, getPartitionKey, getServiceName@Deprecated public Object getKey()
ILockpublic boolean isLocked()
ILockpublic boolean isLockedByCurrentThread()
ILockisLockedByCurrentThread in interface ILocktrue if this lock is locked by current thread, false otherwise.public int getLockCount()
ILockgetLockCount in interface ILockpublic long getRemainingLeaseTime()
ILockgetRemainingLeaseTime in interface ILockpublic void lock(long leaseTime,
TimeUnit timeUnit)
ILockAfter lease time, lock will be released..
If the lock is not available then the current thread becomes disabled for thread scheduling purposes and lies dormant until the lock has been acquired.
public void forceUnlock()
ILockforceUnlock in interface ILockpublic ICondition newCondition(String name)
ILockICondition instance that is bound to this
ILock instance with given name.
Before waiting on the condition the lock must be held by the
current thread.
A call to Condition.await() will atomically release the lock
before waiting and re-acquire the lock before the wait returns.
newCondition in interface ILockname - identifier of the new condition instanceICondition instance for this ILock instancepublic void lock()
ILockpublic void lockInterruptibly()
throws InterruptedException
lockInterruptibly in interface LockInterruptedExceptionpublic boolean tryLock()
ILockpublic boolean tryLock(long time,
TimeUnit unit)
throws InterruptedException
ILocktryLock in interface ILocktryLock in interface LockInterruptedExceptionpublic void unlock()
ILockpublic Condition newCondition()
ILockILock.newCondition(String) instead.newCondition in interface ILocknewCondition in interface Lockprotected <T> T invoke(ClientRequest req)
invoke in class ClientProxyCopyright © 2015 Hazelcast, Inc.. All Rights Reserved.