org.mule.util.lock
Interface LockGroup
- All Superinterfaces:
- Disposable
- All Known Implementing Classes:
- InstanceLockGroup
public interface LockGroup
- extends Disposable
Holds reference to all the obtained locks using LockFactory
in order
to release memory of no longer referenced locks.
lock
void lock(String lockId)
unlock
void unlock(String lockId)
tryLock
boolean tryLock(String lockId,
long timeout,
TimeUnit timeUnit)
throws InterruptedException
- Tries to acquire the lock for a certain amount of time
- Parameters:
timeout
- the time in timeUnit to wait until the lock is acquiredtimeUnit
- the time unit of timeout
- Returns:
- true if the lock was successfully acquired, false otherwise
- Throws:
InterruptedException
- if thread was interrupted during the lock acquisition
tryLock
boolean tryLock(String lockId)
lockInterruptibly
void lockInterruptibly(String lockId)
throws InterruptedException
- Throws:
InterruptedException
Copyright © 2003-2014 MuleSoft, Inc.. All Rights Reserved.