Package com.atlassian.jira.util
Class Lock
java.lang.Object
com.atlassian.jira.util.Lock
Used to lock resources using a file system file as a lock
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
LOOP_WAIT_TIME
public static final long LOOP_WAIT_TIME- See Also:
-
-
Constructor Details
-
Lock
-
Lock
-
-
Method Details
-
obtain
- Throws:
IOException
-
obtain
Try to obtain a lock, wait for timeout ms if necessary- Parameters:
timeout- number of milliseconds to wait for (if necessary)- Returns:
- try if the lock was successfully obtained, false otherwise
- Throws:
IOException- if an error occurs creating the lock
-
release
public void release() -
isLocked
public boolean isLocked() -
getLockFilePath
-