Package javax.jcr

Examples of javax.jcr.Node.unlock()


            if ( createdNodes != null && createdNodes.size() > 0 ) {
                bcNode.setProperty(PROPERTY_UNINSTALL_PATHS, createdNodes.toArray(new String[createdNodes.size()]));
            }
            bcNode.save();
        }
        bcNode.unlock();
    }

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


                        log.debug("Ignoring lock on {} held by {}, not held by this session",
                            path, userId);
                    } else if (lock.isSessionScoped()) {
                        log.info("Unlocking session-scoped lock on {} held by {}",
                            path, userId);
                        node.unlock();
                    } else {
                        log.warn("Dropping lock token of permanent lock on {} held by {}",
                            path, userId);
                        session.removeLockToken(lock.getLockToken());
                    }
View Full Code Here

        // verify node is locked
        assertTrue("Node locked", n.isLocked());

        // unlock node
        n.unlock();

        // commit
        utx.commit();

        // verify node is not locked
View Full Code Here

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

        // unlock
        n.unlock();

        // verify lock is no longer live
        assertFalse("Lock not live", lock.isLive());

        // rollback
View Full Code Here

                    "in property " + jcrLockOwner + " of the lock holding " +
                    "node",
                    n1.getProperty(jcrLockOwner).getString(),
                    lock.getLockOwner());
        }
        n1.unlock();
    }

    /**
     * Test if getLockOwner() returns the same value as returned by
     * Session.getUserId at the time that the lock was placed
View Full Code Here

        assertEquals("getLockOwner() must return the same value as returned " +
                "by Session.getUserId at the time that the lock was placed",
                testRootNode.getSession().getUserID(),
                lock.getLockOwner());

        n1.unlock();
    }

    /**
     * Test if a shallow lock does not lock the child nodes of the locked node.
     */
 
View Full Code Here

        node.lock(false, false);
        assertTrue("Locking of a checked-in node failed.",
                node.isLocked());

        node.unlock();
        assertFalse("Unlocking of a checked-in node failed.",
                node.isLocked());
    }

    /**
 
View Full Code Here

        Lock lock2 = n2.lock(false, false);
        assertFalse("Lock.isSessionScoped() must be false if the lock " +
                "is open-scoped",
                lock2.isSessionScoped());

        n2.unlock();
    }

    /**
     * Test locks are released when session logs out
     */
 
View Full Code Here

        // assert: refresh must succeed
        lock.refresh();

        // unlock node
        n.unlock();

        // assert: lock must not be alive
        assertFalse("lock must not be alive", lock.isLive());
    }
View Full Code Here

        // assert: lock must be alive
        assertTrue("lock must be alive", lock.isLive());

        // unlock node
        n.unlock();

        // assert: lock must not be alive
        assertFalse("lock must not be alive", lock.isLive());

        // refresh
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.