public class MemoryLockService extends java.lang.Object implements LockService
| Constructor and Description |
|---|
MemoryLockService(TechnicalLoggerService loggerService,
int lockTimeoutSeconds) |
| Modifier and Type | Method and Description |
|---|---|
BonitaLock |
lock(long objectToLockId,
java.lang.String objectType,
long tenantId)
Acquire the lock for the object having type and id in parameters
This method wait for the lock to be available |
BonitaLock |
tryLock(long objectToLockId,
java.lang.String objectType,
long timeout,
java.util.concurrent.TimeUnit timeUnit,
long tenantId)
Acquire the lock for the object having type and id in parameters waiting maximum timeout
This method wait for the lock to be available. |
void |
unlock(BonitaLock lock,
long tenantId) |
public MemoryLockService(TechnicalLoggerService loggerService, int lockTimeoutSeconds)
public void unlock(BonitaLock lock, long tenantId) throws SLockException
unlock in interface LockServiceSLockExceptionpublic BonitaLock lock(long objectToLockId, java.lang.String objectType, long tenantId) throws SLockException, SLockTimeoutException
LockServicelock in interface LockServicetenantId - TODOSLockException - when we were unable to lock due to an unexpected errorSLockTimeoutException - when we were unable to lock due to a timeoutpublic BonitaLock tryLock(long objectToLockId, java.lang.String objectType, long timeout, java.util.concurrent.TimeUnit timeUnit, long tenantId) throws SLockException
LockServicetryLock in interface LockServiceSLockException - when we were unable to lock (not because of the timeout)