Examples of LockContainer


Examples of org.infinispan.util.concurrent.locks.containers.LockContainer

      LockManager lm = TestingUtil.extractLockManager(cache);
      LockAssert.assertNoLocks(
            lm, TestingUtil.extractComponentRegistry(cache).getComponent(InvocationContextContainer.class)
      );

      LockContainer lc = (LockContainer) TestingUtil.extractField(lm, "lockContainer");
      assert lc.size() == 0;
   }
View Full Code Here

Examples of org.infinispan.util.concurrent.locks.containers.LockContainer

         assertFalse("" + key + " lock recorded!", context.hasLockedKey(key));
      }
   }

   public static void assertNoLocks(LockManager lockManager) {
      LockContainer lc = (LockContainer) TestingUtil.extractField(lockManager, "lockContainer");
      assertEquals("Stale locks exist! NumLocksHeld is " + lc.getNumLocksHeld() + " and lock info is " + lockManager.printLockInfo(),
            0, lc.getNumLocksHeld());
   }
View Full Code Here

Examples of org.infinispan.util.concurrent.locks.containers.LockContainer

   private void assertNoLocks() {
      LockManager lm = TestingUtil.extractLockManager(cache);
      LockAssert.assertNoLocks(lm);

      LockContainer lc = (LockContainer) TestingUtil.extractField(lm, "lockContainer");
      assert lc.size() == 0;
   }
View Full Code Here

Examples of org.infinispan.util.concurrent.locks.containers.LockContainer

      LockManager lm = TestingUtil.extractLockManager(cache);
      LockAssert.assertNoLocks(
            lm, TestingUtil.extractComponentRegistry(cache).getComponent(InvocationContextContainer.class)
      );

      LockContainer lc = (LockContainer) TestingUtil.extractField(lm, "lockContainer");
      assert lc.size() == 0;
   }
View Full Code Here

Examples of org.infinispan.util.concurrent.locks.containers.LockContainer

      // can't rely on the negative test since other entries may share the same lock with lock striping.
      assert !icc.createInvocationContext(true, -1).hasLockedKey(key) : key + " lock recorded!";
   }

   public static void assertNoLocks(LockManager lockManager, InvocationContextContainer icc) {
      LockContainer lc = (LockContainer) TestingUtil.extractField(lockManager, "lockContainer");
      assert lc.getNumLocksHeld() == 0 : "Stale locks exist! NumLocksHeld is " + lc.getNumLocksHeld() + " and lock info is " + lockManager.printLockInfo();
   }
View Full Code Here

Examples of org.jboss.cache.util.concurrent.locks.LockContainer

   }

   public void testFqnHashing()
   {
      AbstractLockManagerRecordingTestTL tl = threadLocal.get();     
      LockContainer lc = (LockContainer) TestingUtil.extractField(tl.lm, "lockContainer");
      List<Fqn> fqns = new ArrayList<Fqn>();
      fqns.add(Fqn.ROOT);
      fqns.add(Fqn.fromString("/1"));
      fqns.add(Fqn.fromString("/1/2"));
      fqns.add(Fqn.fromString("/1/2/3"));
      fqns.add(Fqn.fromString("/a/b/c/d"));

      for (Fqn f : fqns) System.out.println("Fqn: " + f + "; hash = " + lc.hashToIndex(f));
   }
View Full Code Here

Examples of org.jboss.cache.util.concurrent.locks.LockContainer

      assert !icc.get().getLocks().contains(fqn) : fqn + " lock recorded!";
   }

   public static void assertNoLocks(LockManager lockManager, InvocationContextContainer icc)
   {
      LockContainer lc = (LockContainer) TestingUtil.extractField(lockManager, "lockContainer");
      assert lc.getNumLocksHeld() == 0 : "Stale locks exist! NumLocksHeld is " + lc.getNumLocksHeld() + " and lock info is " + lockManager.printLockInfo();
      assert icc.get().getLocks().isEmpty() : "Stale (?) locks recorded! " + icc.get().getLocks();
   }
View Full Code Here

Examples of org.jboss.cache.util.concurrent.locks.LockContainer

   }

   public void testFqnHashing()
   {
      AbstractLockManagerRecordingTestTL tl = threadLocal.get();     
      LockContainer lc = (LockContainer) TestingUtil.extractField(tl.lm, "lockContainer");
      List<Fqn> fqns = new ArrayList<Fqn>();
      fqns.add(Fqn.ROOT);
      fqns.add(Fqn.fromString("/1"));
      fqns.add(Fqn.fromString("/1/2"));
      fqns.add(Fqn.fromString("/1/2/3"));
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.