org.mule.util.lock
Class LockAdapter

java.lang.Object
  extended by org.mule.util.lock.LockAdapter
All Implemented Interfaces:
Lock

public class LockAdapter
extends Object
implements Lock

Implementation of Lock that delegates the locking mechanism to a LockGroup but looks like a regular lock from the client's perspective


Constructor Summary
LockAdapter(String lockId, LockGroup lockGroup)
           
 
Method Summary
 void lock()
           
 void lockInterruptibly()
           
 Condition newCondition()
           
 boolean tryLock()
           
 boolean tryLock(long timeout, TimeUnit timeUnit)
           
 void unlock()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LockAdapter

public LockAdapter(String lockId,
                   LockGroup lockGroup)
Method Detail

lock

public void lock()
Specified by:
lock in interface Lock

lockInterruptibly

public void lockInterruptibly()
                       throws InterruptedException
Specified by:
lockInterruptibly in interface Lock
Throws:
InterruptedException

tryLock

public boolean tryLock()
Specified by:
tryLock in interface Lock

tryLock

public boolean tryLock(long timeout,
                       TimeUnit timeUnit)
                throws InterruptedException
Specified by:
tryLock in interface Lock
Throws:
InterruptedException

unlock

public void unlock()
Specified by:
unlock in interface Lock

newCondition

public Condition newCondition()
Specified by:
newCondition in interface Lock


Copyright © 2003-2014 MuleSoft, Inc.. All Rights Reserved.