info.aduna.concurrent.locks
Class ExclusiveLockManager

java.lang.Object
  extended by info.aduna.concurrent.locks.ExclusiveLockManager

public class ExclusiveLockManager
extends java.lang.Object

A lock manager for exclusive locks.

Author:
Arjohn Kampman

Nested Class Summary
protected  class ExclusiveLockManager.ExclusiveDebugLock
           
protected  class ExclusiveLockManager.ExclusiveLock
           
 
Constructor Summary
ExclusiveLockManager()
          Creates an ExclusiveLockManager.
ExclusiveLockManager(boolean trackLocks)
           
 
Method Summary
 Lock getExclusiveLock()
          Gets the exclusive lock.
 Lock tryExclusiveLock()
          Gets the exclusive lock, if available.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExclusiveLockManager

public ExclusiveLockManager()
Creates an ExclusiveLockManager.


ExclusiveLockManager

public ExclusiveLockManager(boolean trackLocks)
Method Detail

tryExclusiveLock

public Lock tryExclusiveLock()
Gets the exclusive lock, if available. This method will return null if the exclusive lock is not immediately available.


getExclusiveLock

public Lock getExclusiveLock()
                      throws java.lang.InterruptedException
Gets the exclusive lock. This method blocks when the exclusive lock is currently in use until it is released.

Throws:
java.lang.InterruptedException


Copyright © 2010 Aduna. All Rights Reserved.