@ThreadSafe public class OwnableReentrantSharedLockContainer<E> extends AbstractSharedLockContainer<E>
OwnableReentrantLocks.ReentrantSharedLockContainer,
OwnableReentrantLock| Constructor and Description |
|---|
OwnableReentrantSharedLockContainer(int concurrencyLevel,
InvocationContextContainer icc)
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(E object) |
int |
getNumLocksHeld() |
protected void |
initLocks(int numLocks) |
boolean |
isLocked(E object) |
boolean |
ownsLock(E object,
Object owner)
Tests if a give owner owns a lock on a specified object.
|
void |
reset()
Clears all locks held and re-initialises stripes.
|
int |
size() |
String |
toString() |
acquireLock, acquireLock, calculateNumberOfSegments, releaseLockpublic OwnableReentrantSharedLockContainer(int concurrencyLevel,
InvocationContextContainer icc)
concurrencyLevel - concurrency level for number of stripes to create. Stripes are created in powers of two, with a minimum of concurrencyLevel created.icc - invocation context container to useprotected void initLocks(int numLocks)
initLocks in class AbstractSharedLockContainer<E>public final OwnableReentrantLock getLock(E object)
object - objectpublic final boolean ownsLock(E object, Object owner)
LockContainerobject - object to checkowner - owner to testpublic final boolean isLocked(E object)
object - objectpublic final int getNumLocksHeld()
public void reset()
LockContainerpublic int size()
Copyright © 2012 JBoss, a division of Red Hat. All Rights Reserved.