com.atlassian.jira.util
Class Lock
java.lang.Object
com.atlassian.jira.util.Lock
public class Lock
- extends Object
Used to lock resources using a file system file as a lock
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LOOP_WAIT_TIME
public static final long LOOP_WAIT_TIME
- See Also:
- Constant Field Values
Lock
public Lock(String fileName)
Lock
public Lock(String directoryName,
String fileName)
obtain
public boolean obtain()
throws IOException
- Throws:
IOException
obtain
public boolean obtain(long timeout)
throws IOException
- 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
public String getLockFilePath()
Copyright © 2002-2011 Atlassian. All Rights Reserved.