Package org.cyclos.impl.locks
Class LockHandlerImpl
- java.lang.Object
-
- org.cyclos.impl.locks.LockHandlerImpl
-
- All Implemented Interfaces:
LockHandler
@Component public class LockHandlerImpl extends Object implements LockHandler
ALockHandlerthat delegates locks to the database
-
-
Constructor Summary
Constructors Constructor Description LockHandlerImpl()
-
Method Summary
All Methods Instance Methods Concrete 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
public void lock(LockKey key) throws LockAcquisitionException
Description copied from interface:LockHandlerLocks the given id on the given lock type.- Specified by:
lockin interfaceLockHandler- Throws:
LockAcquisitionException
-
lock
public void lock(LockKey key, long timeInMillis) throws LockAcquisitionException
Description copied from interface:LockHandlerWaits the given time to acquire the locks the given id on the given lock type- Specified by:
lockin interfaceLockHandler- Throws:
LockAcquisitionException
-
tryLock
public boolean tryLock(LockKey key)
Description copied from interface:LockHandlerLocks the given id on the given lock type only if it is free at the time of invocation.- Specified by:
tryLockin interfaceLockHandler
-
-