Package com.atlassian.jira.issue.index
Class IndexLock
java.lang.Object
com.atlassian.jira.issue.index.IndexLock
An index lock that can be acquired using a configurable time out.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanObtains a lock by waiting for the specified time (in milliseconds).booleantryLock(int lockWaitTime) Tries to acquire this lock using a timeout ofIndexingConfiguration.getIndexLockWaitTime()milliseconds.voidunlock()Unlocks this lock.
-
Constructor Details
-
IndexLock
-
-
Method Details
-
tryLock
public boolean tryLock(int lockWaitTime) Tries to acquire this lock using a timeout ofIndexingConfiguration.getIndexLockWaitTime()milliseconds.- Returns:
- a boolean indicating whether the lock was acquired within the timeout
-
unlock
public void unlock()Unlocks this lock. -
obtain
Obtains a lock by waiting for the specified time (in milliseconds).- Parameters:
waitFor- the awaitable to wait forlockWaitTimeMs- the time to wait for the lock in milliseconds- Returns:
- a boolean indicating whether the lock was acquired within the timeout or not
-