Examples of LockManager


Examples of org.freeplane.features.url.mindmapmode.LockManager

   */
  public MMapModel() {
    super();
    addExtension(IUndoHandler.class, new UndoHandler());
    this.setLockManager(ResourceController.getResourceController().getBooleanProperty(
        "experimental_file_locking_on") ? new LockManager() : new DummyLockManager());
    EventQueue.invokeLater(new Runnable() {
      public void run() {
        scheduleTimerForAutomaticSaving();
      }
    });
View Full Code Here

Examples of org.globus.workspace.LockManager

                           final String curStr,
                           final String tarStr)

            throws ManageException {

        final LockManager lockManager = resource.getLockManager();
        final Lock lock = lockManager.getLock(id);
        final Lock destroy_lock = lockManager.getLock("destroy_" + id);

        if (current >= STATE_CANCELLING_STAGING_IN
                        && current <= STATE_CANCELLING_STAGING_OUT) {

View Full Code Here

Examples of org.infinispan.util.concurrent.locks.LockManager

         }
      });

      EntryFactory entryFactory = mock(EntryFactory.class);
      DataContainer dataContainer = mock(DataContainer.class);
      LockManager lockManager = mock(LockManager.class);
      StateTransferManager stateTransferManager = mock(StateTransferManager.class);

      TestAddress A = new TestAddress(0, "A");
      TestAddress B = new TestAddress(1, "B");
      List<Address> members1 = new ArrayList<Address>();
View Full Code Here

Examples of org.infinispan.util.concurrent.locks.LockManager

   /**
    * Verifies the cache doesn't contain any lock
    * @param cache
    */
   public static void assertNoLocks(Cache<?,?> cache) {
      LockManager lm = TestingUtil.extractLockManager(cache);
      for (Object key : cache.keySet()) assert !lm.isLocked(key);
   }
View Full Code Here

Examples of org.infinispan.util.concurrent.locks.LockManager

   /**
    * Verifies the cache doesn't contain any lock
    * @param cache
    */
   public static void assertNoLocks(Cache<?,?> cache) {
      LockManager lm = TestingUtil.extractLockManager(cache);
      for (Object key : cache.keySet()) assert !lm.isLocked(key);
   }
View Full Code Here

Examples of org.infinispan.util.concurrent.locks.LockManager

   protected void assertLocked(Cache cache, Object key) {
      assert checkLocked(cache, key) : "expected key '" + key + "' to be locked on cache " + cache + ", but it is not";
   }

   protected boolean checkLocked(Cache cache, Object key) {
      LockManager lockManager = TestingUtil.extractLockManager(cache);
      return lockManager.isLocked(key);
   }
View Full Code Here

Examples of org.infinispan.util.concurrent.locks.LockManager

      sleepThread(1000);
      t2.interrupt();
      TestingUtil.killCacheManagers(cm2);
      sleepThread(1100);
      t1.interrupt();
      LockManager lm = TestingUtil.extractComponent(cm1.getCache(), LockManager.class);
      Object owner = lm.getOwner(key);
      assert ownerIsLocalOrUnlocked(owner, cm1.getAddress()) : "Bad lock owner " + owner;
   }
View Full Code Here

Examples of org.infinispan.util.concurrent.locks.LockManager

         return currentStored;
      }

      private void checkNoLocks() {
         for (Cache c : caches) {
            LockManager lockManager = c.getAdvancedCache().getComponentRegistry().getComponent(LockManager.class);
            if (lockManager.isLocked(SHARED_KEY)) {
               fail("lock on the entry wasn't cleaned up");
            }
         }
      }
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

   public void testNoLocalTransaction() throws Exception
   {
      TestListener listener = new TestListener();

      CacheSPI<Object, Object> cache = createCacheWithListener(listener);
      LockManager lockManager = TestingUtil.extractLockManager(cache);

      TransactionManager mgr = cache.getConfiguration().getRuntimeConfig().getTransactionManager();
      assertNull(mgr.getTransaction());

      assertEquals(0, cache.getTransactionTable().getNumGlobalTransactions());
      assertEquals(0, cache.getTransactionTable().getNumLocalTransactions());

      SamplePojo pojo = new SamplePojo(21, "test");

      cache.put("/one/two", "key1", pojo);

      assertNull(mgr.getTransaction());
      assertEquals(0, cache.getTransactionTable().getNumGlobalTransactions());
      assertEquals(0, cache.getTransactionTable().getNumLocalTransactions());

      assertTrue(cache.exists(Fqn.fromString("/one/two")));
      assertNotNull(cache.getRoot().getChild("one"));
      assertEquals(false, lockManager.isLocked(cache.getRoot()));
      assertEquals(false, lockManager.isLocked(cache.getNode("/one")));
      assertEquals(false, lockManager.isLocked(cache.getNode("/one/two")));
      assertNotNull(cache.getNode("/one").getChild("two"));
      assertNotNull(cache.get(Fqn.fromString("/one/two"), "key1"));

      assertEquals(2, listener.getNodesAdded());
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.