Class AlwaysFailUpdate


  • class AlwaysFailUpdate
    extends RefUpdate
    Update that always rejects with LOCK_FAILURE.
    • Constructor Detail

      • AlwaysFailUpdate

        AlwaysFailUpdate​(RefTreeDatabase refdb,
                         java.lang.String name)
    • Method Detail

      • getRefDatabase

        protected RefDatabase getRefDatabase()
        Get the reference database this update modifies.
        Specified by:
        getRefDatabase in class RefUpdate
        Returns:
        the reference database this update modifies.
      • getRepository

        protected Repository getRepository()
        Get the repository storing the database's objects.
        Specified by:
        getRepository in class RefUpdate
        Returns:
        the repository storing the database's objects.
      • tryLock

        protected boolean tryLock​(boolean deref)
                           throws java.io.IOException
        Try to acquire the lock on the reference.

        If the locking was successful the implementor must set the current identity value by calling RefUpdate.setOldObjectId(ObjectId).

        Specified by:
        tryLock in class RefUpdate
        Parameters:
        deref - true if the lock should be taken against the leaf level reference; false if it should be taken exactly against the current reference.
        Returns:
        true if the lock was acquired and the reference is likely protected from concurrent modification; false if it failed.
        Throws:
        java.io.IOException - the lock couldn't be taken due to an unexpected storage failure, and not because of a concurrent update.