Package javax.jcr

Examples of javax.jcr.Node.lock()


        testRootNode.save();

        // get user transaction object, start and lock node
        UserTransaction utx = new UserTransactionImpl(superuser);
        utx.begin();
        Lock lock = n.lock(false, true);

        // verify lock is live
        assertTrue("Lock live", lock.isLive());

        // rollback
View Full Code Here


        Node n = testRootNode.addNode(nodeName1);
        n.addMixin(mixLockable);
        n.addMixin(mixReferenceable);
        testRootNode.save();

        Lock lock = n.lock(false, true);

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

        testRootNode.save();

        // get user transaction object, start and lock node
        UserTransaction utx = new UserTransactionImpl(superuser);
        utx.begin();
        Lock lock = n.lock(false, true);

        // verify that the lock properties have been created and are neither
        // NEW nor MODIFIED.
        assertTrue(n.hasProperty(jcrLockOwner));
        Property lockOwner = n.getProperty(jcrLockOwner);
View Full Code Here

        Node n = testRootNode.addNode(nodeName1);
        n.addMixin(mixLockable);
        n.addMixin(mixReferenceable);
        testRootNode.save();

        Lock lock = n.lock(false, true);
        try {
            // get user transaction object, start
            UserTransaction utx = new UserTransactionImpl(superuser);
            utx.begin();
View Full Code Here

        Node n = testRootNode.addNode(nodeName1);
        n.addMixin(mixLockable);
        n.addMixin(mixReferenceable);
        testRootNode.save();

        Lock lock = n.lock(false, true);

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

        utx = new UserTransactionImpl(superuser);
        utx.begin();
       
        n = superuser.getNodeByUUID(uuid);
        // lock this new node
        Lock lock = n.lock(true, false);
       
        // verify node is locked
        assertTrue("Node not locked", n.isLocked());
       
        String lockToken = lock.getLockToken();
View Full Code Here

        Node lockedNode2 = testRoot2.addNode(nodeName2, testNodeType);
        lockedNode2.addMixin(mixLockable);
        testRoot2.save();

        Lock lock2 = lockedNode2.lock(false, isSessionScoped());

        // force reloading of the testroot in order to be aware of the
        // locked node added by another session
        testRootNode.refresh(false);
        Node n2 = (Node) superuser.getItem(lockedNode2.getPath());
View Full Code Here

               HierarchicalProperty href = new HierarchicalProperty(new QName("D", "href"), lock.getLockOwner());
               body.addChild(owner).addChild(href);
            }
            else
            {
               lock = node.lock((depth.getIntValue() != 1), false);
            }
            lockToken = lock.getLockToken();
         }
         catch (PathNotFoundException pexc)
         {
View Full Code Here

         Node lockNode = addNodePath(repoPath);
         lockNode.setProperty("jcr:data", "node data");
         lockNode.addMixin("mix:lockable");
         session.save();

         Lock lock = lockNode.lock(false, false);
         session.save();

         sb.append("ok");
      }
      catch (RepositoryException e)
View Full Code Here

                  node.addMixin("mix:lockable");
                  session.save();
               }
            }

            Lock lock = node.lock((depth.getIntValue() != 1), false);
            lockToken = lock.getLockToken();
         }
         catch (PathNotFoundException pexc)
         {
            lockToken = nullResourceLocks.addLock(session, path);
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.