public class InstanceLockGroup extends Object implements LockGroup
LockGroup
implementation for holding references
to created locks inside a mule instance.Modifier and Type | Class and Description |
---|---|
static class |
InstanceLockGroup.LockEntry |
PHASE_NAME
Constructor and Description |
---|
InstanceLockGroup(LockProvider lockProvider) |
Modifier and Type | Method and Description |
---|---|
void |
dispose()
A lifecycle method where implementor should free up any resources.
|
void |
lock(String lockId) |
void |
lockInterruptibly(String lockId) |
boolean |
tryLock(String lockId) |
boolean |
tryLock(String lockId,
long timeout,
TimeUnit timeUnit)
Tries to acquire the lock for a certain amount of time
|
void |
unlock(String key) |
public InstanceLockGroup(LockProvider lockProvider)
public boolean tryLock(String lockId, long timeout, TimeUnit timeUnit) throws InterruptedException
LockGroup
tryLock
in interface LockGroup
timeout
- the time in timeUnit to wait until the lock is acquiredtimeUnit
- the time unit of timeoutInterruptedException
- if thread was interrupted during the lock acquisitionpublic void lockInterruptibly(String lockId) throws InterruptedException
lockInterruptibly
in interface LockGroup
InterruptedException
public void dispose()
Disposable
dispose
in interface Disposable
Copyright © 2003–2016 MuleSoft, Inc.. All rights reserved.