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);
}
Aggregations