Examples of lock()


Examples of org.apache.lucene.index.DocumentsWriterPerThreadPool.ThreadState.lock()

        infoStream.message("DW", "abort");
      }
      final int limit = perThreadPool.getActiveThreadState();
      for (int i = 0; i < limit; i++) {
        final ThreadState perThread = perThreadPool.getThreadState(i);
        perThread.lock();
        try {
          abortThreadState(perThread, newFilesSet);
        } finally {
          perThread.unlock();
        }
View Full Code Here

Examples of org.apache.maven.index.fs.Locker.lock()

            fetcher.connect( context.getId(), context.getIndexUpdateUrl() );
        }

        File cacheDir = updateRequest.getLocalIndexCacheDir();
        Locker locker = updateRequest.getLocker();
        Lock lock = locker != null && cacheDir != null ? locker.lock( cacheDir ) : null;
        try
        {
            if ( cacheDir != null )
            {
                LocalCacheIndexAdaptor cache = new LocalCacheIndexAdaptor( cacheDir, result );
View Full Code Here

Examples of org.apache.maven.scm.provider.integrity.Sandbox.lock()

        IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
        try
        {
            Sandbox siSandbox = iRepo.getSandbox();
            File memberFile = new File( workingDirectory.getAbsoluteFile() + File.separator + filename );
            Response res = siSandbox.lock( memberFile, filename );
            int exitCode = res.getExitCode();
            boolean success = ( exitCode == 0 ? true : false );
            result = new ScmResult( res.getCommandString(), "", "Exit Code: " + exitCode, success );
        }
        catch ( APIException aex )
View Full Code Here

Examples of org.apache.ojb.odmg.TransactionExt.lock()

        /* One possibility of storing objects is to use the current transaction
         associated with the container */
        try
        {
            TransactionExt tx = (TransactionExt) odmg.currentTransaction();
            tx.lock(object, Transaction.WRITE);
            tx.markDirty(object);
        }
        catch (LockNotGrantedException e)
        {
            log.error("Failure while storing object " + object, e);
View Full Code Here

Examples of org.apache.ojb.odmg.TransactionImpl.lock()

            elements.add(entry);
            // if we are in a transaction: get locks !
            TransactionImpl tx = getTransaction();
            if ((tx != null) && (tx.isOpen()))
            {
                tx.lock(this, Transaction.WRITE);
                tx.lock(entry, Transaction.WRITE);
                tx.lock(o, Transaction.READ);
            }
            return true;
        }
View Full Code Here

Examples of org.apache.slide.lock.Lock.lock()

       SlideToken slideToken = new SlideTokenImpl(new CredentialsToken(caller));
       Lock lock = nat.getLockHelper();
      
       try {
           nat.begin();
           lock.lock(slideToken,new NodeLock(uri,subject,type,expire,isExclusive,isInherit));
           nat.commit();
       }
       catch (Exception e) {
           try {
               nat.rollback();
View Full Code Here

Examples of org.apache.wicket.security.hive.BasicHive.lock()

      }
    }
    inputReaders.clear();
    if (!readAnything)
      log.warn("No policyFiles or inputstreams were added to the factory!");
    hive.lock();
    return hive;
  }

  /**
   * Reads principals and permissions from a file, found items are added to the hive.
View Full Code Here

Examples of org.apache.zookeeper.recipes.lock.WriteLock.lock()

      return;
    }
    WriteLock l = null;
    try {
      l = new WriteLock(zk, "/ironcount/workloads/" + w.name,null);
      l.lock();
      List<String> children = zk.getChildren("/ironcount/workloads/" + w.name, false);
      if (children.size() <= w.maxWorkers){
        WorkerThread wt = new WorkerThread(this,w);
        this.executor.submit(wt);
        this.workerThreads.put(wt, new Object());
View Full Code Here

Examples of org.codehaus.groovy.reflection.ClassInfo.lock()

            else
              return mc;
        }
        else {
            ClassInfo info = ClassInfo.getClassInfo(object.getClass());
            info.lock();
            try {
                return info.getPerInstanceMetaClass(object);
            }
            finally {
                info.unlock();
View Full Code Here

Examples of org.datanucleus.ManagedConnection.lock()

    final boolean enlisted;
    enlisted = om.getTransaction().isActive();
    mc = cf.getConnection(enlisted ? om : null, null); // Will throw exception if already locked

    // Lock the connection now that it is in use by the user
    mc.lock();

    Runnable closeRunnable = new Runnable() {
      public void run() {
        // Unlock the connection now that the user has finished with it
        mc.unlock();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.