Package org.fcrepo.kernel.api.lock
Interface ResourceLockManager
public interface ResourceLockManager
Responsible for managing write locks on Fedora resources
- Author:
- pwinckles
-
Method Summary
Modifier and TypeMethodDescriptionvoidacquireExclusive(String txId, FedoraId resourceId) Acquires an exclusive lock on the resource, associating it to the txId.voidacquireNonExclusive(String txId, FedoraId resourceId) Acquires a non-exclusive lock on the resource, associating it to the txId.voidreleaseAll(String txId) Releases all of the locks held by the transaction
-
Method Details
-
acquireExclusive
Acquires an exclusive lock on the resource, associating it to the txId. If the lock is held by a different transaction, an exception is thrown. If the lock is already held by the same transaction, then it returns successfully.- Parameters:
txId- the transaction id to associate the lock toresourceId- the resource to lock- Throws:
ConcurrentUpdateException- when lock cannot be acquired
-
acquireNonExclusive
Acquires a non-exclusive lock on the resource, associating it to the txId. If an exclusive lock is held by a different transaction, an exception is thrown. Otherwise, a non-exclusive lock on the resource is acquired.- Parameters:
txId- the transaction id to associate the lock toresourceId- the resource to lock- Throws:
ConcurrentUpdateException- when lock cannot be acquired
-
releaseAll
Releases all of the locks held by the transaction- Parameters:
txId- the transaction id
-