Package railo.commons.lock

Examples of railo.commons.lock.LockException


public class RWKeyLock<K> {

  private Map<K,RWLock<K>> locks=new HashMap<K,RWLock<K>>();
 
  public Lock lock(K token, long timeout, boolean readOnly) throws LockException, LockInterruptedException {
    if(timeout<=0) throw new LockException("timeout must be a postive number");
   
    RWWrap<K> wrap;
    //K token=key;
    synchronized (locks) {
      RWLock<K> lock;
View Full Code Here


    this.label=label;
  }

 
  public void lock(long timeout, boolean readOnly) throws LockException, LockInterruptedException {
    if(timeout<=0) throw new LockException("timeout must be a postive number");
    try {
      if(!getLock(readOnly).tryLock(timeout, TimeUnit.MILLISECONDS)){
        throw new LockException(timeout);
      }
    }
    catch (InterruptedException e) {
      throw new LockInterruptedException(e);
    }
View Full Code Here

TOP

Related Classes of railo.commons.lock.LockException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.