Infinispan Distribution 5.2.6.Final-redhat-2

org.infinispan.util.concurrent.locks
Class OwnableRefCountingReentrantLock

java.lang.Object
  extended by java.util.concurrent.locks.AbstractOwnableSynchronizer
      extended by java.util.concurrent.locks.AbstractQueuedSynchronizer
          extended by org.infinispan.util.concurrent.locks.OwnableReentrantLock
              extended by org.infinispan.util.concurrent.locks.OwnableRefCountingReentrantLock
All Implemented Interfaces:
Serializable, Lock, RefCountingLock

public class OwnableRefCountingReentrantLock
extends OwnableReentrantLock
implements RefCountingLock

A version of OwnableReentrantLock that has a reference counter, and implements RefCountingLock. Used with a lock-per-entry container, in this case the OwnableReentrantPerEntryLockContainer.

Since:
5.2
Author:
Manik Surtani
See Also:
OwnableReentrantPerEntryLockContainer, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.concurrent.locks.AbstractQueuedSynchronizer
AbstractQueuedSynchronizer.ConditionObject
 
Constructor Summary
OwnableRefCountingReentrantLock()
           
 
Method Summary
 AtomicInteger getReferenceCounter()
          Accesses the reference counter for this lock
 String toString()
          Returns a string identifying this lock, as well as its lock state.
 
Methods inherited from class org.infinispan.util.concurrent.locks.OwnableReentrantLock
currentRequestor, getHoldCount, getOwner, isHeldExclusively, isLocked, lock, lock, lockInterruptibly, newCondition, tryAcquire, tryLock, tryLock, tryLock, tryRelease, unlock, unlock, unsetCurrentRequestor
 
Methods inherited from class java.util.concurrent.locks.AbstractQueuedSynchronizer
acquire, acquireInterruptibly, acquireShared, acquireSharedInterruptibly, compareAndSetState, getExclusiveQueuedThreads, getFirstQueuedThread, getQueuedThreads, getQueueLength, getSharedQueuedThreads, getState, getWaitingThreads, getWaitQueueLength, hasContended, hasQueuedThreads, hasWaiters, isQueued, owns, release, releaseShared, setState, tryAcquireNanos, tryAcquireShared, tryAcquireSharedNanos, tryReleaseShared
 
Methods inherited from class java.util.concurrent.locks.AbstractOwnableSynchronizer
getExclusiveOwnerThread, setExclusiveOwnerThread
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.concurrent.locks.Lock
lock, lockInterruptibly, newCondition, tryLock, tryLock, unlock
 

Constructor Detail

OwnableRefCountingReentrantLock

public OwnableRefCountingReentrantLock()
Method Detail

getReferenceCounter

public AtomicInteger getReferenceCounter()
Description copied from interface: RefCountingLock
Accesses the reference counter for this lock

Specified by:
getReferenceCounter in interface RefCountingLock
Returns:
a reference counter

toString

public String toString()
Description copied from class: OwnableReentrantLock
Returns a string identifying this lock, as well as its lock state. The state, in brackets, includes either the String "Unlocked" or the String "Locked by" followed by the String representation of the lock owner.

Overrides:
toString in class OwnableReentrantLock
Returns:
a string identifying this lock, as well as its lock state.

Infinispan Distribution 5.2.6.Final-redhat-2

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