|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.hazelcast.client.spi.ClientProxy com.hazelcast.client.proxy.ClientLockProxy
public class ClientLockProxy
Constructor Summary | |
---|---|
ClientLockProxy(String serviceName,
String objectId)
|
Method Summary | ||
---|---|---|
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
|
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. |
Methods inherited from class com.hazelcast.client.spi.ClientProxy |
---|
destroy, equals, getContext, getId, getName, getPartitionKey, getServiceName, hashCode, invoke, invoke, invokeInterruptibly, listen, listen, onDestroy, onInitialize, onShutdown, setContext, stopListening, throwExceptionIfNull, toData, toObject |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.hazelcast.core.DistributedObject |
---|
destroy, getId, getName, getPartitionKey, getServiceName |
Constructor Detail |
---|
public ClientLockProxy(String serviceName, String objectId)
Method Detail |
---|
@Deprecated public Object getKey()
ILock
getKey
in interface ILock
public boolean isLocked()
ILock
isLocked
in interface ILock
true
if this lock is locked, false
otherwise.public boolean isLockedByCurrentThread()
ILock
isLockedByCurrentThread
in interface ILock
true
if this lock is locked by current thread, false
otherwise.public int getLockCount()
ILock
getLockCount
in interface ILock
public long getRemainingLeaseTime()
ILock
getRemainingLeaseTime
in interface ILock
public void lock(long leaseTime, TimeUnit timeUnit)
ILock
After 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.
lock
in interface ILock
leaseTime
- time to wait before releasing the lock.timeUnit
- unit of time for the lease time.public void forceUnlock()
ILock
forceUnlock
in interface ILock
public ICondition newCondition(String name)
ILock
ICondition
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 ILock
name
- identifier of the new condition instance
ICondition
instance for this ILock
instancepublic void lock()
ILock
lock
in interface ILock
lock
in interface Lock
public void lockInterruptibly() throws InterruptedException
lockInterruptibly
in interface Lock
InterruptedException
public boolean tryLock()
ILock
tryLock
in interface ILock
tryLock
in interface Lock
public boolean tryLock(long time, TimeUnit unit) throws InterruptedException
ILock
tryLock
in interface ILock
tryLock
in interface Lock
InterruptedException
public void unlock()
ILock
unlock
in interface ILock
unlock
in interface Lock
public Condition newCondition()
ILock
ILock.newCondition(String)
instead.
newCondition
in interface ILock
newCondition
in interface Lock
protected <T> T invoke(ClientRequest req)
invoke
in class ClientProxy
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |