org.infinispan.util.concurrent.locks.containers
Class OwnableReentrantPerEntryLockContainer
java.lang.Object
org.infinispan.util.concurrent.locks.containers.AbstractLockContainer<L>
org.infinispan.util.concurrent.locks.containers.AbstractPerEntryLockContainer<OwnableRefCountingReentrantLock>
org.infinispan.util.concurrent.locks.containers.OwnableReentrantPerEntryLockContainer
- All Implemented Interfaces:
- LockContainer<OwnableRefCountingReentrantLock>
public class OwnableReentrantPerEntryLockContainer
- extends AbstractPerEntryLockContainer<OwnableRefCountingReentrantLock>
A per-entry lock container for OwnableReentrantLocks
- Since:
- 4.0
- Author:
- Manik Surtani
OwnableReentrantPerEntryLockContainer
public OwnableReentrantPerEntryLockContainer(int concurrencyLevel)
getLog
protected Log getLog()
- Specified by:
getLog
in class AbstractLockContainer<OwnableRefCountingReentrantLock>
newLock
protected OwnableRefCountingReentrantLock newLock()
- Specified by:
newLock
in class AbstractPerEntryLockContainer<OwnableRefCountingReentrantLock>
ownsLock
public boolean ownsLock(Object key,
Object owner)
- Description copied from interface:
LockContainer
- Tests if a give owner owns a lock on a specified object.
- Parameters:
key
- object to checkowner
- 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
tryLock
protected boolean tryLock(OwnableRefCountingReentrantLock lock,
long timeout,
TimeUnit unit,
Object lockOwner)
throws InterruptedException
- Specified by:
tryLock
in class AbstractLockContainer<OwnableRefCountingReentrantLock>
- Throws:
InterruptedException
lock
protected void lock(OwnableRefCountingReentrantLock lock,
Object lockOwner)
- Specified by:
lock
in class AbstractLockContainer<OwnableRefCountingReentrantLock>
unlock
protected void unlock(OwnableRefCountingReentrantLock l,
Object owner)
- Specified by:
unlock
in class AbstractLockContainer<OwnableRefCountingReentrantLock>
Copyright © 2013 JBoss, a division of Red Hat. All Rights Reserved.