Package com.volantis.mcs.repository.lock

Examples of com.volantis.mcs.repository.lock.Lock.acquire()


            String principalName = args[1];
            Principal principal = new JDBCPrincipal(principalName);
            String resource = args[2];

            Lock lock = manager.getLock(resource);
            lock.acquire(principal);
        } else if (command.equals("unlock")) {

            if (args.length != 3) {
                usage("lock <principal> <resource>");
            }
View Full Code Here


        // =====================================================================
        //   Test Expectations
        // =====================================================================
        Lock lock = new JDBCLock(lockManagerMock, RESOURCE_ID, null, -1);
        boolean locked = lock.acquire(fred);
        assertTrue("Locked", locked);

        assertEquals("Principal unexpected", fred, lock.getOwner());
        assertEquals("Acquisition time incorrect", 12345L,
                lock.getAcquisitionTime());
View Full Code Here

        // =====================================================================
        //   Test Expectations
        // =====================================================================
        Lock lock = new JDBCLock(lockManagerMock, RESOURCE_ID, null, -1);
        boolean locked = lock.acquire(fred);
        assertFalse("Unlocked", locked);

        assertEquals("Principal unexpected", wilma, lock.getOwner());
        assertEquals("Acquisition time incorrect", 54321L,
                lock.getAcquisitionTime());
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.