|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectecologylab.generic.Debug
ecologylab.io.LockFile
public class LockFile
Simple utility to write and detect lock files.
| Constructor Summary | |
|---|---|
LockFile(java.lang.String uniqueProgramName)
Takes a program name to check/generate lockfile state. |
|
| Method Summary | |
|---|---|
void |
close()
Gets rid of the file handler (for garbage collection) |
java.io.File |
getFileLock()
Gets a File reference to the actual file lock. |
boolean |
isLocked()
Determine weather or not the program is locked right now. |
boolean |
isOld()
Return true if the lock file exists, and is older than 90 seconds ago. |
boolean |
lock()
Lock the program (create a lockfile). |
boolean |
unlock()
Unlock the program (delete the lockfile). |
| Methods inherited from class ecologylab.generic.Debug |
|---|
classSimpleName, closeLoggingFile, debug, debug, debug, debug, debugA, debugA, debugA, debugI, debugI, debugI, error, error, getClassName, getClassName, getInteractive, getPackageName, getPackageName, getPackageName, initialize, level, level, level, logToFile, print, print, println, println, println, println, println, println, printlnA, printlnA, printlnA, printlnI, printlnI, printlnI, printlnI, setLoggingFile, show, show, superString, toggleInteractive, toString, toString, warning, warning, weird, weird |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public LockFile(java.lang.String uniqueProgramName)
uniqueProgramName - The unique name of the program concerned with locking.| Method Detail |
|---|
public boolean lock()
public boolean unlock()
public boolean isLocked()
public boolean isOld()
public void close()
public java.io.File getFileLock()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||