Interface LockContainer
-
- All Known Implementing Classes:
PerKeyLockContainer,StripedLockContainer
public interface LockContainerA container for locks- Since:
- 4.0
- Author:
- Manik Surtani, Mircea.Markus@jboss.com, Pedro Ruivo
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ExtendedLockPromiseacquire(Object key, Object lockOwner, long time, TimeUnit timeUnit)voiddeadlockCheck(DeadlockChecker deadlockChecker)It forces a deadlock checks in all existing locks.InfinispanLockgetLock(Object key)intgetNumLocksHeld()booleanisLocked(Object key)voidrelease(Object key, Object lockOwner)intsize()
-
-
-
Method Detail
-
acquire
ExtendedLockPromise acquire(Object key, Object lockOwner, long time, TimeUnit timeUnit)
- Parameters:
key- the key to lock.- Returns:
- the lock for a specific object to be acquired. If the lock does not exists, it is created.
-
getLock
InfinispanLock getLock(Object key)
- Parameters:
key- the key to lock.- Returns:
- the lock for a specific object. If the lock does not exists, it return
null.
-
getNumLocksHeld
int getNumLocksHeld()
- Returns:
- number of locks held
-
isLocked
boolean isLocked(Object key)
- Parameters:
key- the key to test.- Returns:
trueif the key is locked,falseotherwise.
-
size
int size()
- Returns:
- the size of the shared lock pool
-
deadlockCheck
void deadlockCheck(DeadlockChecker deadlockChecker)
It forces a deadlock checks in all existing locks.
-
-