Search in sources :

Example 1 with NodeTypeCache

use of org.apache.jackrabbit.jcr2spi.nodetype.NodeTypeCache in project jackrabbit by apache.

the class WorkspaceManager method createNodeTypeRegistry.

/**
     * @param nsRegistry The namespace registry.
     * @return an instance of <code>NodeTypeRegistryImpl</code>.
     */
private NodeTypeRegistryImpl createNodeTypeRegistry(NamespaceRegistry nsRegistry) {
    NodeTypeStorage ntst = new NodeTypeStorage() {

        public Iterator<QNodeTypeDefinition> getAllDefinitions() throws RepositoryException {
            return service.getQNodeTypeDefinitions(sessionInfo);
        }

        public Iterator<QNodeTypeDefinition> getDefinitions(Name[] nodeTypeNames) throws NoSuchNodeTypeException, RepositoryException {
            return service.getQNodeTypeDefinitions(sessionInfo, nodeTypeNames);
        }

        public void registerNodeTypes(QNodeTypeDefinition[] nodeTypeDefs, boolean allowUpdate) throws RepositoryException {
            service.registerNodeTypes(sessionInfo, nodeTypeDefs, allowUpdate);
        }

        public void unregisterNodeTypes(Name[] nodeTypeNames) throws NoSuchNodeTypeException, RepositoryException {
            service.unregisterNodeTypes(sessionInfo, nodeTypeNames);
        }
    };
    NodeTypeCache ntCache = NodeTypeCache.getInstance(service, sessionInfo.getUserID());
    ntst = ntCache.wrap(ntst);
    return NodeTypeRegistryImpl.create(ntst, nsRegistry);
}
Also used : QNodeTypeDefinition(org.apache.jackrabbit.spi.QNodeTypeDefinition) NodeTypeCache(org.apache.jackrabbit.jcr2spi.nodetype.NodeTypeCache) NodeTypeStorage(org.apache.jackrabbit.spi.commons.nodetype.NodeTypeStorage)

Aggregations

NodeTypeCache (org.apache.jackrabbit.jcr2spi.nodetype.NodeTypeCache)1 QNodeTypeDefinition (org.apache.jackrabbit.spi.QNodeTypeDefinition)1 NodeTypeStorage (org.apache.jackrabbit.spi.commons.nodetype.NodeTypeStorage)1