Package railo.commons.lock

Examples of railo.commons.lock.Lock


  @Override
  public LockData lock(int type, String name, int timeout, int pageContextId) throws LockTimeoutException, InterruptedException {
    if(!caseSensitive)name=name.toLowerCase();
    //if(type==LockManager.TYPE_READONLY) return new ReadLockData(name,pageContextId);
    if(timeout<=0)timeout=1;
    Lock lock;
    try {
      lock=locks.lock(name,timeout,type==LockManager.TYPE_READONLY);
    } catch (LockException e) {
      throw new LockTimeoutException(type,name,timeout);
    }
View Full Code Here


   
    return new LockDataImpl(lock,name,pageContextId,type==LockManager.TYPE_READONLY);
  }
 
  public void unlock(LockData data) {
    Lock l = data.getLock();
    locks.unlock(l);
  }
View Full Code Here

      //AppListenerSupport listener = (AppListenerSupport) config.get ApplicationListener();
      KeyLock<String> lock = config.getContextLock();
      String name=StringUtil.emptyIfNull(applicationContext.getName());
      String token=name+":"+getCFID();
     
      Lock tokenLock = lock.lock(token,getRequestTimeout());
      //print.o("outer-lock  :"+token);
      try {
        // check session before executing any code
        initSession=applicationContext.isSetSessionManagement() && listener.hasOnSessionStart(this) && !scopeContext.hasExistingSessionScope(this);
       
        // init application
       
        Lock nameLock = lock.lock(name,getRequestTimeout());
        //print.o("inner-lock  :"+token);
        try {
          RefBoolean isNew=new RefBooleanImpl(false);
          application=scopeContext.getApplicationScope(this,isNew);// this is needed that the application scope is initilized
          if(isNew.toBooleanValue()) {
View Full Code Here

    this.log = searchEngine.getLogger();
  }

  @Override
  public final void create() throws SearchException {
    Lock l = lock();
    try {
      _create();
  }
    finally {
      unlock(l);
View Full Code Here

   */
  protected abstract void _create() throws SearchException;

    @Override
    public final void optimize() throws SearchException  {
      Lock l = lock();
         try {
         _optimize();
        changeLastUpdate();
    }
     finally {
View Full Code Here

     */
    protected abstract void _optimize() throws SearchException ;

    @Override
    public final void map(Resource path) throws SearchException  {
      Lock l = lock();
      try {
        _map(path);
        changeLastUpdate();
    }
    finally {
View Full Code Here

     */
    protected abstract void _map(Resource path) throws SearchException ;

    @Override
    public final void repair() throws SearchException  {
      Lock l = lock();
      try {
        _repair();
        changeLastUpdate();
    }
    finally {
View Full Code Here

    this.log = searchEngine.getLogger();
  }

  @Override
  public final void create() throws SearchException {
    Lock l = lock();
    try {
      _create();
  }
    finally {
      unlock(l);
View Full Code Here

   */
  protected abstract void _create() throws SearchException;

    @Override
    public final void optimize() throws SearchException  {
      Lock l = lock();
         try {
         _optimize();
        changeLastUpdate();
    }
     finally {
View Full Code Here

     */
    protected abstract void _optimize() throws SearchException ;

    @Override
    public final void map(Resource path) throws SearchException  {
      Lock l = lock();
      try {
        _map(path);
        changeLastUpdate();
    }
    finally {
View Full Code Here

TOP

Related Classes of railo.commons.lock.Lock

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.