public interface Lock
LockType| Modifier and Type | Method and Description |
|---|---|
LockName |
getName()
Get LockName
LockName associated with the Lock. |
LockState |
getState()
Get current state
LockState of the Lock. |
void |
lock()
Acquire the lock.
|
boolean |
tryLock()
Acquires the lock only if it is available at the time of invocation.
|
boolean |
tryLock(long timeOut,
TimeUnit unit)
Acquire lock with a timeout.
|
void |
unlock()
Release the lock which is previously acquired.
|
void lock()
throws InterruptedException,
ServiceNotAvailableException,
IOException
InterruptedException - Thread interrupted exceptionServiceNotAvailableException - Lock service is down currentlyIOException - IO exception while data serializationboolean tryLock(long timeOut,
TimeUnit unit)
throws InterruptedException,
ServiceNotAvailableException,
IOException
timeOut - Timeout valueunit - Timeout unitInterruptedException - Thread interrupted exceptionServiceNotAvailableException - Lock service down exceptionIOException - IO exception while data serializationboolean tryLock()
throws ServiceNotAvailableException,
InterruptedException,
IOException
ServiceNotAvailableException - Lock service is downInterruptedException - Operation interrupted exceptionIOException - IO Exception while data serializationvoid unlock()
throws LockServiceException.LockNotAquiredException,
ServiceNotAvailableException,
InterruptedException
LockServiceException.LockNotAquiredException - Lock is not in aquired stateServiceNotAvailableException - Lock service is downInterruptedException - Operation interrupted exceptionLockName getName()
LockName associated with the Lock.Copyright © 2014. All Rights Reserved.