org.mule.util.lock
Class InstanceLockGroup
java.lang.Object
org.mule.util.lock.InstanceLockGroup
- All Implemented Interfaces:
- Disposable, LockGroup
public class InstanceLockGroup
- extends Object
- implements LockGroup
LockGroup
implementation for holding references
to created locks inside a mule instance.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
InstanceLockGroup
public InstanceLockGroup(LockProvider lockProvider)
lock
public void lock(String lockId)
- Specified by:
lock
in interface LockGroup
unlock
public void unlock(String key)
- Specified by:
unlock
in interface LockGroup
tryLock
public boolean tryLock(String lockId,
long timeout,
TimeUnit timeUnit)
throws InterruptedException
- Description copied from interface:
LockGroup
- Tries to acquire the lock for a certain amount of time
- Specified by:
tryLock
in interface LockGroup
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
public boolean tryLock(String lockId)
- Specified by:
tryLock
in interface LockGroup
lockInterruptibly
public void lockInterruptibly(String lockId)
throws InterruptedException
- Specified by:
lockInterruptibly
in interface LockGroup
- Throws:
InterruptedException
dispose
public void dispose()
- Description copied from interface:
Disposable
- A lifecycle method where implementor should free up any resources. If an
exception is thrown it should just be logged and processing should continue.
This method should not throw Runtime exceptions.
- Specified by:
dispose
in interface Disposable
Copyright © 2003-2014 MuleSoft, Inc.. All Rights Reserved.