Interface LockContainer
-
- All Known Implementing Classes:
PerKeyLockContainer
,StripedLockContainer
public interface LockContainer
A 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 ExtendedLockPromise
acquire(Object key, Object lockOwner, long time, TimeUnit timeUnit)
void
deadlockCheck(DeadlockChecker deadlockChecker)
It forces a deadlock checks in all existing locks.InfinispanLock
getLock(Object key)
int
getNumLocksHeld()
boolean
isLocked(Object key)
void
release(Object key, Object lockOwner)
int
size()
-
-
-
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:
true
if the key is locked,false
otherwise.
-
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.
-
-