jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r949152 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java
Date Fri, 28 May 2010 11:31:26 GMT
Author: jukka
Date: Fri May 28 11:31:25 2010
New Revision: 949152

URL: http://svn.apache.org/viewvc?rev=949152&view=rev
Log:
JCR-2640: Internal repository context

Restore factory methods that subclasses can use to override the default namespace and node
type registries.

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java?rev=949152&r1=949151&r2=949152&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java
Fri May 28 11:31:25 2010
@@ -98,7 +98,6 @@ import org.apache.jackrabbit.core.securi
 import org.apache.jackrabbit.core.state.CacheManager;
 import org.apache.jackrabbit.core.state.ChangeLog;
 import org.apache.jackrabbit.core.state.ISMLocking;
-import org.apache.jackrabbit.core.state.ItemStateCacheFactory;
 import org.apache.jackrabbit.core.state.ItemStateException;
 import org.apache.jackrabbit.core.state.ManagedMLRUItemStateCacheFactory;
 import org.apache.jackrabbit.core.state.SharedItemStateManager;
@@ -291,10 +290,8 @@ public class RepositoryImpl extends Abst
             initRepositoryDescriptors();
 
             // create registries
-            context.setNamespaceRegistry(
-                    new NamespaceRegistryImpl(context.getFileSystem()));
-            context.setNodeTypeRegistry(new NodeTypeRegistry(
-                    context.getNamespaceRegistry(), context.getFileSystem()));
+            context.setNamespaceRegistry(createNamespaceRegistry());
+            context.setNodeTypeRegistry(createNodeTypeRegistry());
 
             // Create item state cache manager
             context.setItemStateCacheFactory(
@@ -400,6 +397,33 @@ public class RepositoryImpl extends Abst
     }
 
     /**
+     * Protected factory method for creating the namespace registry.
+     * Called by the constructor after the repository file system has
+     * been initialised.
+     *
+     * @return namespace registry
+     * @throws RepositoryException if the namespace registry can not be created
+     */
+    protected NamespaceRegistryImpl createNamespaceRegistry()
+            throws RepositoryException {
+        return new NamespaceRegistryImpl(context.getFileSystem());
+    }
+
+    /**
+     * Protected factory method for creating the node type registry.
+     * Called by the constructor after the repository file system and
+     * namespace registry have been initialised.
+     *
+     * @return node type registry
+     * @throws RepositoryException if the node type registry can not be created
+     */
+    protected NodeTypeRegistry createNodeTypeRegistry()
+            throws RepositoryException {
+        return new NodeTypeRegistry(
+                context.getNamespaceRegistry(), context.getFileSystem());
+    }
+
+    /**
      * Returns the internal component context of this repository.
      * This package-private method should only be used when there is
      * no other reasonable way to access the repository context.
@@ -528,7 +552,7 @@ public class RepositoryImpl extends Abst
     private NodeId loadRootNodeId() throws RepositoryException {
         try {
             FileSystemResource uuidFile = new FileSystemResource(
-                    context.getFileSystem(), "meta/rootUUID");
+                    context.getFileSystem(), "/meta/rootUUID");
             if (uuidFile.exists()) {
                 // Load uuid of the repository's root node. It is stored in
                 // text format (36 characters) for better readability.



Mime
View raw message