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
Modifier and TypeMethodDescriptionvoid
deadlockCheck
(DeadlockChecker deadlockChecker) It forces a deadlock checks in all existing locks.int
boolean
void
int
size()
-
Method Details
-
acquire
- 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
- Parameters:
key
- the key to lock.- Returns:
- the lock for a specific object. If the lock does not exists, it return
null
.
-
release
-
getNumLocksHeld
int getNumLocksHeld()- Returns:
- number of locks held
-
isLocked
- 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
It forces a deadlock checks in all existing locks.
-