public class Lock extends Object
| Modifier and Type | Field and Description |
|---|---|
static long |
LOOP_WAIT_TIME |
| Constructor and Description |
|---|
Lock(String fileName) |
Lock(String directoryName,
String fileName) |
| Modifier and Type | Method and Description |
|---|---|
String |
getLockFilePath() |
boolean |
isLocked() |
boolean |
obtain() |
boolean |
obtain(long timeout)
Try to obtain a lock, wait for timeout ms if necessary
|
void |
release() |
public static final long LOOP_WAIT_TIME
public Lock(String fileName)
public boolean obtain()
throws IOException
IOExceptionpublic boolean obtain(long timeout)
throws IOException
timeout - number of milliseconds to wait for (if necessary)IOException - if an error occurs creating the lockpublic void release()
public boolean isLocked()
public String getLockFilePath()
Copyright © 2002-2017 Atlassian. All Rights Reserved.