Package org.olat.core.util.coordinate

Examples of org.olat.core.util.coordinate.Locker.acquireLock()


   
    // ------------------ test the clusterlocker ----------------------   
    Locker cl = CoordinatorManager.getCoordinator().getLocker();
   
    // acquire
    LockResult res1 = cl.acquireLock(ores, ident, "abc");
    assertTrue(res1.isSuccess());
    DBFactory.getInstance().closeSession();
   
    // reacquire same identity (get from db)
    LockResult res11 = cl.acquireLock(ores, ident, "abc");
View Full Code Here


    LockResult res1 = cl.acquireLock(ores, ident, "abc");
    assertTrue(res1.isSuccess());
    DBFactory.getInstance().closeSession();
   
    // reacquire same identity (get from db)
    LockResult res11 = cl.acquireLock(ores, ident, "abc");
    long lock1Ac = res11.getLockAquiredTime();
    assertTrue(res11.isSuccess());
    DBFactory.getInstance().closeSession();

    // acquire by another identity must fail
View Full Code Here

    long lock1Ac = res11.getLockAquiredTime();
    assertTrue(res11.isSuccess());
    DBFactory.getInstance().closeSession();

    // acquire by another identity must fail
    LockResult res2 = cl.acquireLock(ores, ident2, "abc");
    assertFalse(res2.isSuccess());
    DBFactory.getInstance().closeSession();

    // reacquire same identity
    LockResult res3 = cl.acquireLock(ores, ident, "abc");
View Full Code Here

    LockResult res2 = cl.acquireLock(ores, ident2, "abc");
    assertFalse(res2.isSuccess());
    DBFactory.getInstance().closeSession();

    // reacquire same identity
    LockResult res3 = cl.acquireLock(ores, ident, "abc");
    assertTrue(res3.isSuccess());
    DBFactory.getInstance().closeSession();

    // test the admin
    List<LockEntry> entries = cl.adminOnlyGetLockEntries();
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.