Package org.eclipse.rdf4j.sail.helpers
Class DirectoryLockManager
java.lang.Object
org.eclipse.rdf4j.sail.helpers.DirectoryLockManager
- All Implemented Interfaces:
LockManager
Used to create a lock in a directory.
- Author:
- James Leigh, Arjohn Kampman
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionTechnical description of where the lock is located, such as a URL.booleanisLocked()Determines if the directory is locked.Creates a lock in a directory if it does not yet exist.booleanRevokes a lock owned by another process.tryLock()Creates a lock in a directory if it does not yet exist.
-
Constructor Details
-
DirectoryLockManager
-
-
Method Details
-
getLocation
Description copied from interface:LockManagerTechnical description of where the lock is located, such as a URL.- Specified by:
getLocationin interfaceLockManager
-
isLocked
public boolean isLocked()Determines if the directory is locked.- Specified by:
isLockedin interfaceLockManager- Returns:
trueif the directory is already locked.
-
tryLock
Creates a lock in a directory if it does not yet exist.- Specified by:
tryLockin interfaceLockManager- Returns:
- a newly acquired lock or null if the directory is already locked.
-
lockOrFail
Creates a lock in a directory if it does not yet exist.- Specified by:
lockOrFailin interfaceLockManager- 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:
revokeLockin interfaceLockManager- Returns:
trueif a lock was successfully revoked.
-