public class LockHelper extends Object
Modifier and Type | Class and Description |
---|---|
static class |
LockHelper.LockTryException
Exception generated when a lock try is unsuccessful
|
Constructor and Description |
---|
LockHelper() |
Modifier and Type | Method and Description |
---|---|
static void |
tryLock(Lock lock,
long timeoutMs,
String useCase)
Try to get a lock in the given number of milliseconds or get an exception
|
public static void tryLock(Lock lock, long timeoutMs, String useCase) throws LockHelper.LockTryException
lock
- the lock to trytimeoutMs
- the number of milliseconds to tryuseCase
- String
value which specifies description of use case when lock is neededLockHelper.LockTryException
- the exception if the time is exceeded or the thread is interruptedCopyright © 2005–2019 Alfresco Software. All rights reserved.