Package org.cyclos.impl.locks
Interface LockHandler
-
- All Known Implementing Classes:
LockHandlerImpl
public interface LockHandlerContains methods to access pessimistic locks on entities
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidlock(LockKey key)Locks the given id on the given lock type.voidlock(LockKey key, long timeInMillis)Waits the given time to acquire the locks the given id on the given lock typebooleantryLock(LockKey key)Locks the given id on the given lock type only if it is free at the time of invocation.
-
-
-
Method Detail
-
lock
void lock(LockKey key) throws LockAcquisitionException
Locks the given id on the given lock type.- Throws:
LockAcquisitionException
-
lock
void lock(LockKey key, long timeInMillis) throws LockAcquisitionException
Waits the given time to acquire the locks the given id on the given lock type- Throws:
LockAcquisitionException
-
tryLock
boolean tryLock(LockKey key)
Locks the given id on the given lock type only if it is free at the time of invocation.
-
-