org.jboss.cache.util.concurrent.locks
Class PerElementReentrantLockContainer<E>

java.lang.Object
  extended by org.jboss.cache.util.concurrent.locks.PerElementLockContainer<E>
      extended by org.jboss.cache.util.concurrent.locks.PerElementReentrantLockContainer<E>
All Implemented Interfaces:
LockContainer<E>

public class PerElementReentrantLockContainer<E>
extends PerElementLockContainer<E>

Per-element container for ReentrantLocks

Since:
3.1.0
Author:
Manik Surtani

Field Summary
 
Fields inherited from class org.jboss.cache.util.concurrent.locks.PerElementLockContainer
locks
 
Constructor Summary
PerElementReentrantLockContainer(int concurrencyLevel)
           
 
Method Summary
 boolean isLocked(E object)
           
protected  Lock newLock()
           
 boolean ownsLock(E object, Object owner)
          Tests if a give owner owns a lock on a specified object.
 
Methods inherited from class org.jboss.cache.util.concurrent.locks.PerElementLockContainer
acquireLock, acquireLock, getLock, getNumLocksHeld, releaseLock, reset, size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PerElementReentrantLockContainer

public PerElementReentrantLockContainer(int concurrencyLevel)
Method Detail

ownsLock

public boolean ownsLock(E object,
                        Object owner)
Description copied from interface: LockContainer
Tests if a give owner owns a lock on a specified object.

Parameters:
object - object to check
owner - owner to test
Returns:
true if owner owns lock, false otherwise

isLocked

public boolean isLocked(E object)
Parameters:
object - object
Returns:
true if an object is locked, false otherwise

newLock

protected final Lock newLock()
Specified by:
newLock in class PerElementLockContainer<E>


Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.