org.infinispan.util.concurrent.locks.containers
Class AbstractLockContainer<L extends Lock>

java.lang.Object
  extended by org.infinispan.util.concurrent.locks.containers.AbstractLockContainer<L>
All Implemented Interfaces:
LockContainer<L>
Direct Known Subclasses:
AbstractPerEntryLockContainer, AbstractStripedLockContainer

public abstract class AbstractLockContainer<L extends Lock>
extends Object
implements LockContainer<L>


Constructor Summary
AbstractLockContainer()
           
 
Method Summary
protected  void safeRelease(L toRelease, Object lockOwner)
          Releases a lock and swallows any IllegalMonitorStateExceptions - so it is safe to call this method even if the lock is not locked, or not locked by the current thread.
protected abstract  boolean tryLock(L lock, long timeout, TimeUnit unit, Object lockOwner)
           
protected abstract  void unlock(L toRelease, Object ctx)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.infinispan.util.concurrent.locks.containers.LockContainer
acquireLock, getLock, getLockId, getNumLocksHeld, isLocked, ownsLock, releaseLock, size
 

Constructor Detail

AbstractLockContainer

public AbstractLockContainer()
Method Detail

safeRelease

protected void safeRelease(L toRelease,
                           Object lockOwner)
Releases a lock and swallows any IllegalMonitorStateExceptions - so it is safe to call this method even if the lock is not locked, or not locked by the current thread.

Parameters:
toRelease - lock to release

unlock

protected abstract void unlock(L toRelease,
                               Object ctx)

tryLock

protected abstract boolean tryLock(L lock,
                                   long timeout,
                                   TimeUnit unit,
                                   Object lockOwner)
                            throws InterruptedException
Throws:
InterruptedException

-->

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