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.


Field Summary
 
Fields inherited from interface org.mule.api.lifecycle.Disposable
PHASE_NAME
 
Method Summary
 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 lockId)
           
 
Methods inherited from interface org.mule.api.lifecycle.Disposable
dispose
 

Method Detail

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 acquired
timeUnit - 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.