|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.hazelcast.spi.AbstractDistributedObject<LockServiceImpl>
com.hazelcast.concurrent.lock.LockProxy
public class LockProxy
| Field Summary |
|---|
| Fields inherited from class com.hazelcast.spi.AbstractDistributedObject |
|---|
PARTITIONING_STRATEGY |
| Constructor Summary | |
|---|---|
LockProxy(NodeEngine nodeEngine,
LockServiceImpl lockService,
String name)
|
|
| Method Summary | |
|---|---|
static String |
convertToStringKey(Object key,
SerializationService serializationService)
|
void |
forceUnlock()
Releases the lock regardless of the lock owner. |
Object |
getKey()
Deprecated. |
Data |
getKeyData()
|
int |
getLockCount()
Returns re-entrant lock hold count, regardless of lock ownership. |
String |
getName()
Returns the unique name for this DistributedObject. |
int |
getPartitionId()
|
long |
getRemainingLeaseTime()
Returns remaining lease time in milliseconds. |
String |
getServiceName()
Returns the service name for this object. |
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.spi.AbstractDistributedObject |
|---|
destroy, equals, getId, getNameAsPartitionAwareData, getNodeEngine, getPartitionKey, getService, hashCode, invalidate, postDestroy, throwNotActiveException |
| 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, getPartitionKey |
| Constructor Detail |
|---|
public LockProxy(NodeEngine nodeEngine,
LockServiceImpl lockService,
String name)
| Method Detail |
|---|
public boolean isLocked()
ILock
isLocked in interface ILocktrue if this lock is locked, false otherwise.public boolean isLockedByCurrentThread()
ILock
isLockedByCurrentThread in interface ILocktrue if this lock is locked by current thread, false otherwise.public int getLockCount()
ILock
getLockCount in interface ILockpublic long getRemainingLeaseTime()
ILock
getRemainingLeaseTime in interface ILockpublic void lock()
ILock
lock in interface ILocklock in interface Lock
public 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.
lock in interface ILockleaseTime - time to wait before releasing the lock.timeUnit - unit of time for the lease time.
public void lockInterruptibly()
throws InterruptedException
lockInterruptibly in interface LockInterruptedExceptionpublic boolean tryLock()
ILock
tryLock in interface ILocktryLock in interface Lock
public boolean tryLock(long time,
TimeUnit unit)
throws InterruptedException
ILock
tryLock in interface ILocktryLock in interface LockInterruptedExceptionpublic void unlock()
ILock
unlock in interface ILockunlock in interface Lockpublic void forceUnlock()
ILock
forceUnlock in interface ILockpublic Condition newCondition()
ILockILock.newCondition(String) instead.
newCondition in interface ILocknewCondition in interface Lockpublic 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 instance
ICondition instance for this ILock instancepublic String getName()
DistributedObject
getName in interface DistributedObjectpublic String getServiceName()
DistributedObject
getServiceName in interface DistributedObjectgetServiceName in class AbstractDistributedObject<LockServiceImpl>@Deprecated public Object getKey()
ILock
getKey in interface ILockpublic Data getKeyData()
public int getPartitionId()
public static String convertToStringKey(Object key,
SerializationService serializationService)
public String toString()
toString in class AbstractDistributedObject<LockServiceImpl>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||