|
Elexis API documentationVersion 2.1.6 as of December 11 2011 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectch.rgw.io.LockFile
public class LockFile
A class that creates and detects lockfile to provide cooperative detection od running instances of an applicatiion (or for other purposes)
Constructor Summary | |
---|---|
LockFile(java.io.File dir,
java.lang.String basename,
int maxNum,
int timeoutSeconds)
Create an instance of a LockFile class. |
Method Summary | |
---|---|
boolean |
existsLock()
Check if at least one lockfile with the given pattern exists |
int |
lock()
create a lockfile with the parameters as given to the constructor. |
boolean |
updateLock(int n)
Refresh the lock i.e. extend its validity time by the original timeout once again. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LockFile(java.io.File dir, java.lang.String basename, int maxNum, int timeoutSeconds)
dir
- the dir where the lockfile(s) should be createdbasename
- the basename for the filesmaxNum
- maximum number of instances of this lock that may be aquired simultaneouslytimeoutSeconds
- after what time will a lock treaded as invalidMethod Detail |
---|
public int lock() throws java.io.IOException
java.io.IOException
- id something went wrongpublic boolean updateLock(int n)
n
- number of the lockfile (as received by the lock() call)
public boolean existsLock() throws java.io.IOException
java.io.IOException
|
Elexis API documentationVersion 2.1.6 as of December 11 2011 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |