@ThreadSafe public class OwnableReentrantStripedLockContainer extends AbstractStripedLockContainer<OwnableReentrantLock>
OwnableReentrantLocks.ReentrantStripedLockContainer,
OwnableReentrantLock| Constructor and Description |
|---|
OwnableReentrantStripedLockContainer(int concurrencyLevel)
Creates a new LockContainer which uses a certain number of shared locks across all elements that need to be
locked.
|
| Modifier and Type | Method and Description |
|---|---|
OwnableReentrantLock |
getLock(Object object) |
int |
getNumLocksHeld() |
protected void |
initLocks(int numLocks) |
boolean |
isLocked(Object object) |
boolean |
ownsLock(Object object,
Object owner)
Tests if a give owner owns a lock on a specified object.
|
int |
size() |
String |
toString() |
protected boolean |
tryLock(OwnableReentrantLock lock,
long timeout,
TimeUnit unit,
Object lockOwner) |
protected void |
unlock(OwnableReentrantLock l,
Object owner) |
acquireLock, getLockId, releaseLocksafeReleasepublic OwnableReentrantStripedLockContainer(int concurrencyLevel)
concurrencyLevel - concurrency level for number of stripes to create. Stripes are created in powers of two,
with a minimum of concurrencyLevel created.protected void initLocks(int numLocks)
initLocks in class AbstractStripedLockContainer<OwnableReentrantLock>public final OwnableReentrantLock getLock(Object object)
object - objectpublic final boolean ownsLock(Object object, Object owner)
LockContainerobject - object to checkowner - owner to testpublic final boolean isLocked(Object object)
object - objectpublic final int getNumLocksHeld()
public int size()
protected boolean tryLock(OwnableReentrantLock lock, long timeout, TimeUnit unit, Object lockOwner) throws InterruptedException
tryLock in class AbstractLockContainer<OwnableReentrantLock>InterruptedExceptionprotected void unlock(OwnableReentrantLock l, Object owner)
unlock in class AbstractLockContainer<OwnableReentrantLock>Copyright © 2012 JBoss by Red Hat. All Rights Reserved.