org.openrdf.sail.rdbms.util
Class DatabaseLockManager

java.lang.Object
  extended by org.openrdf.sail.rdbms.util.DatabaseLockManager
All Implemented Interfaces:
LockManager

public class DatabaseLockManager
extends Object
implements LockManager

Author:
James Leigh

Constructor Summary
DatabaseLockManager(DataSource ds)
           
DatabaseLockManager(DataSource ds, String user, String password)
           
 
Method Summary
 String getLocation()
          Technical description of where the lock is located, such as a URL.
 boolean isDebugEnabled()
           
 boolean isLocked()
          Determines if the SAIL is locked.
 Lock lockOrFail()
          Creates a lock in a SAIL if it does not yet exist.
 boolean revokeLock()
          Revokes a lock owned by another process.
 Lock tryLock()
          Creates a lock in a SAIL if it does not yet exist.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatabaseLockManager

public DatabaseLockManager(DataSource ds)

DatabaseLockManager

public DatabaseLockManager(DataSource ds,
                           String user,
                           String password)
Method Detail

getLocation

public String getLocation()
Description copied from interface: LockManager
Technical description of where the lock is located, such as a URL.

Specified by:
getLocation in interface LockManager

isDebugEnabled

public boolean isDebugEnabled()

isLocked

public boolean isLocked()
Description copied from interface: LockManager
Determines if the SAIL is locked.

Specified by:
isLocked in interface LockManager
Returns:
true if the SAIL is already locked.

tryLock

public Lock tryLock()
Description copied from interface: LockManager
Creates a lock in a SAIL if it does not yet exist.

Specified by:
tryLock in interface LockManager
Returns:
a newly acquired lock or null if the SAIL is already locked.

lockOrFail

public Lock lockOrFail()
                throws SailLockedException
Description copied from interface: LockManager
Creates a lock in a SAIL if it does not yet exist.

Specified by:
lockOrFail in interface LockManager
Returns:
a newly acquired lock.
Throws:
SailLockedException - if the directory is already locked.

revokeLock

public boolean revokeLock()
Revokes a lock owned by another process.

Specified by:
revokeLock in interface LockManager
Returns:
true if a lock was successfully revoked.


Copyright © 2001-2012 Aduna. All Rights Reserved.