Examples of LockManager


Examples of org.jboss.cache.lock.LockManager

   @Override
   protected void assertNoLocks()
   {
      CacheSPI<Object, Object> cache = cacheTL.get();
      ComponentRegistry cr = TestingUtil.extractComponentRegistry(cache);
      LockManager lm = cr.getComponent(LockManager.class);
      InvocationContextContainer icc = cr.getComponent(InvocationContextContainer.class);
      LockAssert.assertNoLocks(lm, icc);
   }
View Full Code Here

Examples of org.jboss.cache.lock.LockManager

      // Pause to give caches time to see each other
      TestingUtil.blockUntilViewsReceived(new CacheSPI[]{cache1, cache2}, 60000);
      createAndActivateRegion(cache2, A_B);
      assertEquals("Incorrect name for /a/b", JOE, cache2.get(A_B, "name"));

      LockManager lockManager = cache1.getComponentRegistry().getComponent(LockManager.class);
      assert  !lockManager.isLocked(A_B);
      cache1.getRegion(A, false).deactivate();
      assert  !lockManager.isLocked(A);
      assert  !lockManager.isLocked(A_B);
      createAndActivateRegion(cache1, A_B);
      assertEquals("Incorrect name for /a/b", JOE, cache1.get(A_B, "name"));
   }
View Full Code Here

Examples of org.jboss.cache.lock.LockManager

      assert !TestingUtil.extractLockManager(cache).isLocked(cache.peek(fqn, true)) : "Node " + fqn + " is locked!!";
   }

   protected void assertLocked(Object owner, Fqn fqn, boolean write_locked)
   {
      LockManager lm = TestingUtil.extractLockManager(cache);
      NodeSPI<String, String> n = cache.peek(fqn, true);
      if (owner == null) owner = Thread.currentThread();
      assertTrue("node " + fqn + " is not locked", lm.isLocked(n));
      if (write_locked)
      {
         assertTrue("node " + fqn + " is not write-locked by owner " + owner, lm.ownsLock(fqn, LockType.WRITE, owner));
      }
      else
      {
         assertTrue("node " + fqn + " is not read-locked by owner " + owner, lm.ownsLock(fqn, LockType.READ, owner));
      }
   }
View Full Code Here

Examples of org.jboss.cache.lock.LockManager

   @Override
   protected void assertLocked(Object owner, Fqn fqn, boolean write_locked)
   {
      if (write_locked)
      {
         LockManager lm = TestingUtil.extractLockManager(cache);
         NodeSPI<String, String> n = cache.peek(fqn, true);
         if (owner == null) owner = Thread.currentThread();
         assertTrue("node " + fqn + " is not locked", lm.isLocked(n));
         assertTrue("node " + fqn + " is not write-locked by owner " + owner, lm.ownsLock(fqn, LockType.WRITE, owner));
      }
   }
View Full Code Here

Examples of org.neo4j.kernel.impl.transaction.LockManager

            TxIdGeneratorFactory txIdFactory, TxFinishHook finishHook,
            LastCommittedTxIdSetter lastCommittedTxIdSetter, FileSystemAbstraction fileSystem )
    {
        this.storeDir = storeDir;
        TxModule txModule = newTxModule( inputParams, finishHook );
        LockManager lockManager = lockManagerFactory.create( txModule );
        LockReleaser lockReleaser = new LockReleaser( lockManager, txModule.getTxManager() );
        final Config config = new Config( graphDbService, storeDir, storeId, inputParams,
                kernelPanicEventGenerator, txModule, lockManager, lockReleaser, idGeneratorFactory,
                new SyncHookFactory(), relTypeCreator, txIdFactory.create( txModule.getTxManager() ),
                lastCommittedTxIdSetter, fileSystem );
View Full Code Here

Examples of org.openrdf.sail.LockManager

  private boolean tryToRemoveLock(SailReadOnlyException e, Repository repo)
    throws IOException, StoreException
  {
    boolean lockRemoved = false;

    LockManager lockManager = new DirectoryLockManager(repo.getDataDir());

    if (lockManager.isLocked()) {
      if (askProceed("WARNING: The lock from another process on this repository needs to be removed", true))
      {
        repo.shutDown();
        lockRemoved = lockManager.revokeLock();
        repo.initialize();
      }
    }

    return lockRemoved;
View Full Code Here

Examples of org.openrdf.sail.LockManager

  private boolean tryToRemoveLock(SailLockedException e)
    throws IOException
  {
    boolean lockRemoved = false;

    LockManager lockManager = e.getLockManager();

    if (lockManager != null && lockManager.isLocked()) {
      if (askProceed("WARNING: The lock from process '" + e.getLockedBy()
          + "' on this repository needs to be removed", true))
      {
        lockRemoved = lockManager.revokeLock();
      }
    }

    return lockRemoved;
  }
View Full Code Here

Examples of railo.runtime.lock.LockManager

  public static void terminate(PageContext pc) {
    Log log = pc.getConfig().getRequestTimeoutLogger();
       
    String strLocks="";
    try{
      LockManager manager = pc.getConfig().getLockManager();
          String[] locks = manager.getOpenLockNames();
          if(!ArrayUtil.isEmpty(locks))
            strLocks=" open locks at this time ("+ListUtil.arrayToList(locks, ", ")+").";
          //LockManagerImpl.unlockAll(pc.getId());
    }
    catch(Throwable t){}
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.