Package org.modeshape.jcr.cache

Examples of org.modeshape.jcr.cache.MutableCachedNode.removeChild()


        SessionCache cache = sessionCache();
        NodeKey key = key();
        MutableCachedNode parent = mutableParent();
        if (!isShareable()) {
            // It's not shareable, so we will always destroy the node immediately ...
            parent.removeChild(cache, key);
            cache.destroy(key);
            return;
        }

        // It is shareable, so we need to check how many shares there are before we remove this node from its parent ...
View Full Code Here


        // It is shareable, so we need to check how many shares there are before we remove this node from its parent ...
        JcrSharedNodeCache shareableNodeCache = session().shareableNodeCache();
        SharedSet sharedSet = shareableNodeCache.getSharedSet(this);
        if (sharedSet.getSize() <= 1) {
            // There are no shares, so destroy the node and the shared set ...
            parent.removeChild(cache, key);
            cache.destroy(key);
            shareableNodeCache.destroyed(key);
            return;
        }
View Full Code Here

            return;
        }

        // The node being removed is shared to at least two places, so we should remove it from the primary parent,
        // NOT destroy the node, and adjust the SharedSet ...
        parent.removeChild(cache, key);
        shareableNodeCache.removed(this);
    }
}
View Full Code Here

                    assert shareableNodeKey != null;

                    // unlink the current key from its parent references
                    NodeKey parentKey = mutable.getParentKey(cache);
                    MutableCachedNode parent = cache.mutable(parentKey);
                    parent.removeChild(cache, node.key());

                    // re-link it with the correct key - that of the shareable node
                    parent.linkChild(cache, shareableNodeKey, node.name());
                }
            }
View Full Code Here

        // Remove any children that weren't represented by a property definition or child node definition ...
        if (existingChildKeys != null && !existingChildKeys.isEmpty()) {
            for (NodeKey childKey : existingChildKeys) {
                // Remove the child from the parent, then destrot it ...
                nodeTypeNode.removeChild(system, childKey);
                system.destroy(childKey);
            }
        }
    }
View Full Code Here

            // Find the provider node ...
            MutableCachedNode providerNode = system.mutable(providerKey);

            // And remove the index defn from the provider ...
            final NodeKey key = nodeKey(providerNode.getKey(), indexDefn);
            providerNode.removeChild(system, key);
            system.destroy(key);

            // If there are no more children under the provider, remove it, too...
            if (providerNode.getChildReferences(system).isEmpty()) {
                indexes.removeChild(system, providerKey);
View Full Code Here

        // Remove any column defns that weren't represented in the index definition ...
        if (existingChildKeys != null && !existingChildKeys.isEmpty()) {
            for (NodeKey childKey : existingChildKeys) {
                // Remove the child from the parent, then destroy it ...
                indexNode.removeChild(system, childKey);
                system.destroy(childKey);
            }
        }
    }
View Full Code Here

                    continue;
                }
                // Otherwise, the prefix was bound to another URI, so this means we're taking an existing prefix already bound
                // to one URI and assigning it to another URI. Per the JavaDoc for javax.jcr.Namespace#register(String,String)
                // the old URI is to be unregistered -- meaning we should delete it ...
                namespaces.removeChild(system, ref.getKey());
                system.destroy(ref.getKey());
                continue;
            }

            // Look for an existing namespace node that uses the same URI ...
View Full Code Here

    protected boolean unregisterNamespace( String namespaceUri ) {
        MutableCachedNode namespaces = mutableNamespacesNode();
        NodeKey key = keyForNamespaceUri(namespaceUri);
        CachedNode nsNode = system.getNode(key);
        if (nsNode != null) {
            namespaces.removeChild(system, key);
            system.destroy(key);
            return true;
        }
        return false;
    }
View Full Code Here

    protected void unregisterNodeTypes( JcrNodeType... nodeTypes ) {
        MutableCachedNode nodeTypesNode = mutableNodeTypesNode();
        for (JcrNodeType nodeType : nodeTypes) {
            NodeKey nodeTypeKey = nodeType.key();
            nodeTypesNode.removeChild(system, nodeTypeKey);
            system.destroy(nodeTypeKey);
        }
    }

    protected final NodeKey keyForNamespaceUri( String namespaceUri ) {
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.