Package javax.jcr.lock

Examples of javax.jcr.lock.LockManager.lock()


            AccessDeniedException, InvalidItemStateException,
            RepositoryException {
        // check state of this instance
        sanityCheck();
        LockManager lockMgr = ((WorkspaceImpl) session.getWorkspace()).getLockManager();
        return lockMgr.lock(getPath(), isDeep, isSessionScoped, Long.MAX_VALUE, null);
    }

    /**
     * {@inheritDoc}
     */
 
View Full Code Here


     */
    public void testLockJcr2() throws Exception {
        LockManager lockManager = version.getSession().getWorkspace().getLockManager();
        String path = version.getPath();
        try {
            lockManager.lock(path, true, true, 60, "");
            fail("Version should not be lockable: Version.lock(true,true) did not throw a LockException");
        } catch (LockException success) {
        }
        try {
            lockManager.lock(path, true, false, 60, "");
View Full Code Here

            lockManager.lock(path, true, true, 60, "");
            fail("Version should not be lockable: Version.lock(true,true) did not throw a LockException");
        } catch (LockException success) {
        }
        try {
            lockManager.lock(path, true, false, 60, "");
            fail("Version should not be lockable: Version.lock(true,false) did not throw a LockException");
        } catch (LockException success) {
        }
        try {
            lockManager.lock(path, false, true, 60, "");
View Full Code Here

            lockManager.lock(path, true, false, 60, "");
            fail("Version should not be lockable: Version.lock(true,false) did not throw a LockException");
        } catch (LockException success) {
        }
        try {
            lockManager.lock(path, false, true, 60, "");
            fail("Version should not be lockable: Version.lock(false,true) did not throw a LockException");
        } catch (LockException success) {
        }
        try {
            lockManager.lock(path, false, false, 60, "");
View Full Code Here

            lockManager.lock(path, false, true, 60, "");
            fail("Version should not be lockable: Version.lock(false,true) did not throw a LockException");
        } catch (LockException success) {
        }
        try {
            lockManager.lock(path, false, false, 60, "");
            fail("Version should not be lockable: Version.lock(false,false) did not throw a LockException");
        } catch (LockException success) {
        }
    }
View Full Code Here

     */
    public void testLockJcr2() throws Exception {
        LockManager lockManager = vHistory.getSession().getWorkspace().getLockManager();
        String path = vHistory.getPath();
        try {
            lockManager.lock(path, true, true, 60, "");
            fail("VersionHistory should not be lockable: VersionHistory.lock(true,true) did not throw a LockException");
        } catch (LockException success) {
        }
        try {
            lockManager.lock(path, true, false, 60, "");
View Full Code Here

            lockManager.lock(path, true, true, 60, "");
            fail("VersionHistory should not be lockable: VersionHistory.lock(true,true) did not throw a LockException");
        } catch (LockException success) {
        }
        try {
            lockManager.lock(path, true, false, 60, "");
            fail("VersionHistory should not be lockable: VersionHistory.lock(true,false) did not throw a LockException");
        } catch (LockException success) {
        }
        try {
            lockManager.lock(path, false, true, 60, "");
View Full Code Here

            lockManager.lock(path, true, false, 60, "");
            fail("VersionHistory should not be lockable: VersionHistory.lock(true,false) did not throw a LockException");
        } catch (LockException success) {
        }
        try {
            lockManager.lock(path, false, true, 60, "");
            fail("VersionHistory should not be lockable: VersionHistory.lock(false,true) did not throw a LockException");
        } catch (LockException success) {
        }
        try {
            lockManager.lock(path, false, false, 60, "");
View Full Code Here

            lockManager.lock(path, false, true, 60, "");
            fail("VersionHistory should not be lockable: VersionHistory.lock(false,true) did not throw a LockException");
        } catch (LockException success) {
        }
        try {
            lockManager.lock(path, false, false, 60, "");
            fail("VersionHistory should not be lockable: VersionHistory.lock(false,false) did not throw a UnsupportedRepositoryOperationException");
        } catch (LockException success) {
        }
    }
View Full Code Here

            AccessDeniedException, InvalidItemStateException,
            RepositoryException {
        // check state of this instance
        sanityCheck();
        LockManager lockMgr = session.getWorkspace().getLockManager();
        return lockMgr.lock(getPath(), isDeep, isSessionScoped, Long.MAX_VALUE, null);
    }

    /**
     * {@inheritDoc}
     */
 
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.