public interface InterProcessLock
Modifier and Type | Method and Description |
---|---|
void |
acquire()
Acquire the mutex - blocking until it's available.
|
boolean |
acquire(long time,
java.util.concurrent.TimeUnit unit)
Acquire the mutex - blocks until it's available or the given time expires.
|
boolean |
isAcquiredInThisProcess()
Returns true if the mutex is acquired by a thread in this JVM
|
void |
release()
Perform one release of the mutex if the calling thread is the same thread that acquired it.
|
void acquire() throws java.lang.Exception
release()
java.lang.Exception
- ZK errors, interruptions, another thread owns the lockboolean acquire(long time, java.util.concurrent.TimeUnit unit) throws java.lang.Exception
release()
time
- time to waitunit
- time unitjava.lang.Exception
- ZK errors, interruptions, another thread owns the lockvoid release() throws java.lang.Exception
java.lang.Exception
- ZK errors, interruptions, current thread does not own the lockboolean isAcquiredInThisProcess()