Package javax.jcr

Examples of javax.jcr.Node.unlock()


            // verify lock is live again -> properties must be present
            assertTrue(n.hasProperty(jcrLockOwner));
            assertTrue(n.hasProperty(jcrlockIsDeep));
        } finally {
            n.unlock();
        }
    }

    /**
     * Test visibility of lock properties by another session.
View Full Code Here


        // get user transaction object, start
        UserTransaction utx = new UserTransactionImpl(superuser);
        utx.begin();

        // unlock
        n.unlock();

        Node n2 = (Node) otherSuperuser.getItem(n.getPath());
        assertTrue(n2.isLocked());
        assertTrue(n2.hasProperty(jcrLockOwner));
        assertTrue(n2.hasProperty(jcrlockIsDeep));
View Full Code Here

        lock = otherNode.getLock();

        // assert: session must hold lock token
        assertTrue("session must hold lock token", containsLockToken(other, lock.getLockToken()));       
       
        otherNode.unlock();
       
        assertFalse("Node is locked", otherNode.isLocked());
       
        otherNode.remove();
        other.save();
View Full Code Here

        lock = otherNode.getLock();

        // assert: session must hold lock token
        assertTrue("session must hold lock token", containsLockToken(superuser, lockToken));       
       
        otherNode.unlock();
       
        assertFalse("Node is locked", otherNode.isLocked());
       
        otherNode.remove();
        superuser.save();
View Full Code Here

        superuser.addLockToken(lockToken);
       
        // assert: session must not hold lock token
        assertTrue("session must hold lock token", containsLockToken(superuser, lockToken));

        n.unlock();
       
        // commit
        utx.commit();
    }
View Full Code Here

        lock = otherNode.getLock();

        // assert: session must hold lock token
        assertTrue("session must hold lock token", containsLockToken(other, lock.getLockToken()));       
       
        otherNode.unlock();
       
        assertFalse("Node is locked", otherNode.isLocked());
       
        otherNode.setProperty(propertyName1, "foo");
        other.save();
View Full Code Here

                        synchronized ( this.deletedJobs ) {
                            this.deletedJobs.add(eventNodePath);
                        }
                        // unlock node
                        try {
                            eventNode.unlock();
                        } catch (RepositoryException e) {
                            // if unlock fails, we silently ignore this
                            this.ignoreException(e);
                        }
                        unlock = false;
View Full Code Here

            bcNode.setProperty("content-loaded-by", this.slingId);
            bcNode.setProperty("content-unload-time", (String)null);
            bcNode.setProperty("content-unloaded-by", (String)null);
            bcNode.save();
        }
        bcNode.unlock();
    }

    public void contentIsUninstalled(final Session session,
                                     final Bundle  bundle) {
        final String nodeName = bundle.getSymbolicName();
View Full Code Here

    /**
     * @see javax.jcr.lock.LockManager#unlock(String)
     */
    public void unlock(String absPath) throws LockException, RepositoryException {
        Node n = itemManager.getNode(resolver.getQPath(absPath));
        n.unlock();
    }

    /**
     * Returns the lock tokens present on the <code>SessionInfo</code> this
     * manager has been created with.
View Full Code Here

            } catch (LockException e) {
                // success
            }

            // unlock to remove node at tearDown()
            node2.unlock();
        } finally {
            session2.logout();
        }
    }
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.