Class IndexLock

java.lang.Object
com.atlassian.jira.issue.index.IndexLock

public class IndexLock extends Object
An index lock that can be acquired using a configurable time out.
  • Constructor Details

    • IndexLock

      public IndexLock(Lock lock)
  • Method Details

    • tryLock

      public boolean tryLock(int lockWaitTime)
      Tries to acquire this lock using a timeout of IndexingConfiguration.getIndexLockWaitTime() milliseconds.
      Returns:
      a boolean indicating whether the lock was acquired within the timeout
    • unlock

      public void unlock()
      Unlocks this lock.
    • obtain

      public boolean obtain(Awaitable waitFor, int lockWaitTimeMs)
      Obtains a lock by waiting for the specified time (in milliseconds).
      Parameters:
      waitFor - the awaitable to wait for
      lockWaitTimeMs - the time to wait for the lock in milliseconds
      Returns:
      a boolean indicating whether the lock was acquired within the timeout or not