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<ReentrantLock>
org.infinispan.util.concurrent.locks.containers.ReentrantPerEntryLockContainer
- All Implemented Interfaces:
- LockContainer<ReentrantLock>
public class ReentrantPerEntryLockContainer
- extends AbstractPerEntryLockContainer<ReentrantLock>
A per-entry lock container for ReentrantLocks
- Since:
- 4.0
- Author:
- Manik Surtani
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ReentrantPerEntryLockContainer
public ReentrantPerEntryLockContainer(int concurrencyLevel)
newLock
protected ReentrantLock newLock()
- Specified by:
newLock
in class AbstractPerEntryLockContainer<ReentrantLock>
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(ReentrantLock l,
Object unused)
- Specified by:
unlock
in class AbstractLockContainer<ReentrantLock>
tryLock
protected boolean tryLock(ReentrantLock lock,
long timeout,
TimeUnit unit,
Object unused)
throws InterruptedException
- Specified by:
tryLock
in class AbstractLockContainer<ReentrantLock>
- Throws:
InterruptedException
Copyright © 2012 JBoss, a division of Red Hat. All Rights Reserved.