|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectposix.LockFile
public class LockFile
A simple unix style lock file. The first process to append its process id owns the lock. The lock is stale if the process id no longer exists. There is a race condition when removing stale locks.
| Constructor Summary | |
|---|---|
LockFile(String name)
Create a unix style lockfile. |
|
| Method Summary | |
|---|---|
void |
delete()
Remove the lockfile. |
void |
finalize()
Remove the lockfile when garbage collected. |
static void |
main(String[] argv)
Exercise LockFile. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LockFile(String name)
throws IOException
name - the unix path name of the lockfile
IOException - if the lockfile is already owned or cannot be created| Method Detail |
|---|
public void finalize()
finalize in class Objectpublic void delete()
public static void main(String[] argv)
throws IOException
IOException
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||