org.infinispan.util.concurrent.locks.containers
Class ReentrantPerEntryLockContainer
java.lang.Object
org.infinispan.util.concurrent.locks.containers.AbstractLockContainer<L>
org.infinispan.util.concurrent.locks.containers.AbstractPerEntryLockContainer<VisibleOwnerRefCountingReentrantLock>
org.infinispan.util.concurrent.locks.containers.ReentrantPerEntryLockContainer
- All Implemented Interfaces:
- LockContainer<VisibleOwnerRefCountingReentrantLock>
public class ReentrantPerEntryLockContainer
- extends AbstractPerEntryLockContainer<VisibleOwnerRefCountingReentrantLock>
A per-entry lock container for ReentrantLocks
- Since:
- 4.0
- Author:
- Manik Surtani
ReentrantPerEntryLockContainer
public ReentrantPerEntryLockContainer(int concurrencyLevel)
getLog
protected Log getLog()
- Specified by:
getLog
in class AbstractLockContainer<VisibleOwnerRefCountingReentrantLock>
newLock
protected VisibleOwnerRefCountingReentrantLock newLock()
- Specified by:
newLock
in class AbstractPerEntryLockContainer<VisibleOwnerRefCountingReentrantLock>
ownsLock
public boolean ownsLock(Object key,
Object ignored)
- Description copied from interface:
LockContainer
- Tests if a give owner owns a lock on a specified object.
- Parameters:
key
- object to checkignored
- owner to test
- Returns:
- true if owner owns lock, false otherwise
isLocked
public boolean isLocked(Object key)
- Parameters:
key
- object
- Returns:
- true if an object is locked, false otherwise
unlock
protected void unlock(VisibleOwnerRefCountingReentrantLock l,
Object unused)
- Specified by:
unlock
in class AbstractLockContainer<VisibleOwnerRefCountingReentrantLock>
tryLock
protected boolean tryLock(VisibleOwnerRefCountingReentrantLock lock,
long timeout,
TimeUnit unit,
Object unused)
throws InterruptedException
- Specified by:
tryLock
in class AbstractLockContainer<VisibleOwnerRefCountingReentrantLock>
- Throws:
InterruptedException
lock
protected void lock(VisibleOwnerRefCountingReentrantLock lock,
Object lockOwner)
- Specified by:
lock
in class AbstractLockContainer<VisibleOwnerRefCountingReentrantLock>
Copyright © 2013 JBoss, a division of Red Hat. All Rights Reserved.