Package org.modeshape.jcr.cache

Examples of org.modeshape.jcr.cache.SessionCache$SaveContext


    @Override
    Path path() throws ItemNotFoundException, InvalidItemStateException {
        AbstractJcrNode parent = parent();
        CachedNode node = parent.node();
        SessionCache cache = session.cache();
        ChildReference childRef = node.getChildReferences(cache).getChild(sharedSet.key());
        Path parentPath = parent.path();
        return session().pathFactory().create(parentPath, childRef.getSegment());
    }
View Full Code Here


    @Override
    protected Segment segment() throws RepositoryException {
        AbstractJcrNode parent = parent();
        CachedNode node = parent.node();
        SessionCache cache = session.cache();
        ChildReference childRef = node.getChildReferences(cache).getChild(sharedSet.key());
        return childRef.getSegment();
    }
View Full Code Here

                    // We still were NOT able to find a definition that allows SNS for this name WITHOUT considering the
                    // specific child node type. This likely means there is either 0 or more than 1 (possibly residual)
                    // child node definitions. We need to find all of the added/renamed child nodes and use their specific
                    // primary types. The first to fail will result in an exception ...
                    final SessionCache session = cache();
                    for (NodeKey appendedOrRenamedKey : appendedOrRenamedChildrenByName.get(childName)) {
                        MutableCachedNode appendedOrRenamedChild = session.mutable(appendedOrRenamedKey);
                        if (appendedOrRenamedChild == null) continue;
                        Name childPrimaryType = appendedOrRenamedChild.getPrimaryType(session);
                        childDefns = nodeTypeCapabilities.findChildNodeDefinitions(primaryType, mixinTypes);
                        childNodeDefinition = childDefns.findBestDefinitionForChild(childName, childPrimaryType, true,
                                                                                    siblingCounter);
View Full Code Here

                NodeKey actualParentKey = shareableNode.parentKey();
                assert actualParentKey != null;
                if (!actualParentKey.equals(parentKey)) {

                    // Obtain the set of keys for all parents ...
                    final SessionCache cache = session.cache();
                    Set<NodeKey> additionalParents = cachedNode.getAdditionalParentKeys(cache);

                    // And get the shared node for the parent key, first making sure the parent exists ...
                    if (additionalParents.contains(parentKey) && session.nodeExists(parentKey)) {
                        return getOrCreateSharedNode(parentKey);
View Full Code Here

         *
         * @return the number of shared nodes; always 1 or more
         * @throws RepositoryException if there's a problem getting the size
         */
        public int getSize() throws RepositoryException {
            final SessionCache cache = session().cache();
            Set<NodeKey> additionalParents = shareableNode.node().getAdditionalParentKeys(cache);
            return additionalParents.size() + 1;
        }
View Full Code Here

         *         size 1 if the node is shareable but hasn't been shared
         * @throws RepositoryException if there is a problem finding the nodes in the set
         */
        public NodeIterator getSharedNodes() throws RepositoryException {
            // Obtain the set of keys for all parents ...
            final SessionCache cache = session().cache();
            Set<NodeKey> additionalParents = shareableNode.node().getAdditionalParentKeys(cache);

            // Obtain the Node objects for each of these ...
            final NodeKey key = shareableNode.key();
            final String workspaceKey = key.getWorkspaceKey();
View Full Code Here

    }

    final SessionCache createSystemCache( boolean readOnly ) {
        // This method returns a SessionCache used by various Session-owned components that can automatically
        // save system content. This session should be notified when such activities happen.
        SessionCache systemCache = repository.createSystemSession(context, readOnly);
        return readOnly ? systemCache : new SystemSessionCache(systemCache);

    }
View Full Code Here

                                   boolean readOnly ) {
        return new JcrSession(repository(), workspaceName, context(), sessionAttributes, readOnly);
    }

    final SessionCache spawnSessionCache( boolean readOnly ) {
        SessionCache cache = repository().repositoryCache().createSession(context(), workspaceName(), readOnly);
        return readOnly ? cache : new SystemSessionCache(cache);
    }
View Full Code Here

        // Get the node at the source path and the parent node of the destination path ...
        AbstractJcrNode srcNode = node(srcPath);
        AbstractJcrNode destParentNode = node(destPath.getParent());

        SessionCache sessionCache = cache();

        // Check whether these nodes are locked ...
        if (srcNode.isLocked() && !srcNode.getLock().isLockOwningSession()) {
            javax.jcr.lock.Lock sourceLock = srcNode.getLock();
            if (sourceLock != null && sourceLock.getLockToken() == null) {
View Full Code Here

        throws AccessDeniedException, ItemExistsException, ReferentialIntegrityException, ConstraintViolationException,
        InvalidItemStateException, VersionException, LockException, NoSuchNodeTypeException, RepositoryException {
        checkLive();

        // Perform the save, using 'JcrPreSave' operations ...
        SessionCache systemCache = createSystemCache(false);
        SystemContent systemContent = new SystemContent(systemCache);
        Map<NodeKey, NodeKey> baseVersionKeys = this.baseVersionKeys.get();
        Map<NodeKey, NodeKey> originalVersionKeys = this.originalVersionKeys.get();
        try {
            cache().save(systemContent.cache(),
View Full Code Here

TOP

Related Classes of org.modeshape.jcr.cache.SessionCache$SaveContext

Copyright © 2018 www.massapicom. 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.