|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.faunos.util.cc.XprocLock
public class XprocLock
A cross-process, file-based locking protocol. The implementation uses an exclusive lock on a local file.
This implementation does not work on every OS/file system combination. For example, if the local file is NTFS mounted through aufs on Linux, then this implementation does not work. Must experiment to find a more robust cross-process lock implementation for this class. Consider this class for the time being a marker for a better implementation.
| Constructor Summary | |
|---|---|
XprocLock(File lockFile)
Creates an instance with the specified lock file. |
|
| Method Summary | |
|---|---|
void |
lock()
Locks the instance by acquiring an exclusive lock on the underlying file passed in at construction. |
void |
release()
Releases the lock. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XprocLock(File lockFile)
lock| Method Detail |
|---|
public void lock()
IllegalStateException - if the underlying file lock could not be acquiredrelease()public void release()
lock()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||