Class PerKeyLockContainer
java.lang.Object
org.infinispan.util.concurrent.locks.impl.PerKeyLockContainer
- All Implemented Interfaces:
LockContainer
A lock container that creates and maintains a new lock per entry.
- Since:
- 8.0
- Author:
- Pedro Ruivo
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
deadlockCheck
(DeadlockChecker deadlockChecker) It forces a deadlock checks in all existing locks.int
boolean
void
int
size()
toString()
-
Field Details
-
nonBlockingExecutor
-
-
Constructor Details
-
PerKeyLockContainer
public PerKeyLockContainer()
-
-
Method Details
-
acquire
- Specified by:
acquire
in interfaceLockContainer
- 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
- Specified by:
getLock
in interfaceLockContainer
- Parameters:
key
- the key to lock.- Returns:
- the lock for a specific object. If the lock does not exists, it return
null
.
-
release
- Specified by:
release
in interfaceLockContainer
-
getNumLocksHeld
public int getNumLocksHeld()- Specified by:
getNumLocksHeld
in interfaceLockContainer
- Returns:
- number of locks held
-
isLocked
- Specified by:
isLocked
in interfaceLockContainer
- Parameters:
key
- the key to test.- Returns:
true
if the key is locked,false
otherwise.
-
size
public int size()- Specified by:
size
in interfaceLockContainer
- Returns:
- the size of the shared lock pool
-
deadlockCheck
Description copied from interface:LockContainer
It forces a deadlock checks in all existing locks.- Specified by:
deadlockCheck
in interfaceLockContainer
-
toString
-