Interface TriggerLockFactory.Lock

Enclosing interface:
TriggerLockFactory

public static interface TriggerLockFactory.Lock
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Checks if the lock is already taken.
    boolean
    Tries to acquire a lock with a given key.
    void
    Releases the lock.
  • Method Details

    • tryLock

      boolean tryLock()
      Tries to acquire a lock with a given key. Anyone already holding a lock would prevent acquiring this lock. Not reentrant.

      Called by TriggerManager. Implementations could assume that are no concurrent calls for this method.

      Returns:
      true if the lock is acquired by this job, false if the lock is already held by someone
    • isHeld

      boolean isHeld()
      Checks if the lock is already taken.
      Returns:
      true if the lock is held by someone
    • unlock

      void unlock()
      Releases the lock. Should not fail if the lock is not held by anyone.

      Called by LockRemover. Implementations could assume that are no concurrent calls for this method.