|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.ode.utils.ProcessMutex
public class ProcessMutex
An inter-process synchronization mechanism. This class uses a well known TCP port to synchronize multiple processes. The method of operation is simple: by opening a port, a process prevents other processes on the local machine from opening the same port.
Constructor Summary | |
---|---|
ProcessMutex(int port)
Constructor. |
Method Summary | |
---|---|
void |
lock()
Acquire the lock. |
void |
unlock()
Release the lock |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ProcessMutex(int port)
port
- synchronization TCP portMethod Detail |
---|
public void lock() throws java.lang.InterruptedException
java.lang.InterruptedException
- in case of timeout
java.lang.IllegalStateException
- in case lock is already acquiredpublic void unlock()
java.lang.IllegalStateException
- DOCUMENTME
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |