Interface ResourceLockManager


  • public interface ResourceLockManager
    Responsible for managing write locks on Fedora resources
    Author:
    pwinckles
    • Method Detail

      • acquireExclusive

        void acquireExclusive​(String txId,
                              FedoraId resourceId)
        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 to
        resourceId - the resource to lock
        Throws:
        ConcurrentUpdateException - when lock cannot be acquired
      • acquireNonExclusive

        void acquireNonExclusive​(String txId,
                                 FedoraId resourceId)
        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 to
        resourceId - the resource to lock
        Throws:
        ConcurrentUpdateException - when lock cannot be acquired
      • releaseAll

        void releaseAll​(String txId)
        Releases all of the locks held by the transaction
        Parameters:
        txId - the transaction id