jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1400105 - in /jackrabbit/oak/trunk: oak-core/src/main/java/org/apache/jackrabbit/oak/Oak.java oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/RepositoryImpl.java oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java
Date Fri, 19 Oct 2012 14:13:18 GMT
Author: jukka
Date: Fri Oct 19 14:13:18 2012
New Revision: 1400105

URL: http://svn.apache.org/viewvc?rev=1400105&view=rev
Log:
OAK-352: Oak builder for simplified repository construction

Address remaining FIXMEs, un-hardcode the OrderedChildEditor.

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/Oak.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/RepositoryImpl.java
    jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/Oak.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/Oak.java?rev=1400105&r1=1400104&r2=1400105&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/Oak.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/Oak.java Fri Oct
19 14:13:18 2012
@@ -30,7 +30,6 @@ import org.apache.jackrabbit.oak.api.Con
 import org.apache.jackrabbit.oak.api.ContentSession;
 import org.apache.jackrabbit.oak.api.Root;
 import org.apache.jackrabbit.oak.core.ContentRepositoryImpl;
-import org.apache.jackrabbit.oak.core.OrderedChildrenEditor;
 import org.apache.jackrabbit.oak.kernel.KernelNodeStore;
 import org.apache.jackrabbit.oak.spi.commit.CommitHook;
 import org.apache.jackrabbit.oak.spi.commit.CompositeHook;
@@ -68,7 +67,7 @@ public class Oak {
 
     private final List<CommitHook> commitHooks = Lists.newArrayList();
 
-    private final List<ValidatorProvider> validatorProviders = Lists.newArrayList();
+    private List<ValidatorProvider> validatorProviders = Lists.newArrayList();
 
     private SecurityProvider securityProvider = new OpenSecurityProvider();
 
@@ -126,7 +125,7 @@ public class Oak {
         if (!validatorProviders.isEmpty()) {
             commitHooks.add(new ValidatingHook(
                     CompositeValidatorProvider.compose(validatorProviders)));
-            //validatorProviders.clear(); FIXME
+            validatorProviders = Lists.newArrayList();
         }
     }
 
@@ -163,7 +162,6 @@ public class Oak {
     @Nonnull
     public Oak with(@Nonnull SecurityProvider securityProvider) {
         this.securityProvider = securityProvider;
-
         try {
             validatorProviders.addAll(securityProvider.getAccessControlProvider().getValidatorProviders());
             validatorProviders.addAll(securityProvider.getUserConfiguration().getValidatorProviders());
@@ -191,7 +189,10 @@ public class Oak {
         for (MicroKernelTracker initializer : initializers) {
             initializer.available(store);
         }
-        store.setHook(createCommitHook());
+
+        withValidatorHook();
+        store.setHook(CompositeHook.compose(commitHooks));
+
         return new ContentRepositoryImpl(
                 store,
                 conflictHandler,
@@ -247,10 +248,4 @@ public class Oak {
         return createContentSession().getLatestRoot();
     }
 
-    private CommitHook createCommitHook() {
-        withValidatorHook();
-        commitHooks.add(new OrderedChildrenEditor()); // FIXME don't hardcode
-        return CompositeHook.compose(commitHooks);
-    }
-
 }
\ No newline at end of file

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/RepositoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/RepositoryImpl.java?rev=1400105&r1=1400104&r2=1400105&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/RepositoryImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/RepositoryImpl.java
Fri Oct 19 14:13:18 2012
@@ -30,6 +30,7 @@ import org.apache.jackrabbit.mk.api.Micr
 import org.apache.jackrabbit.oak.Oak;
 import org.apache.jackrabbit.oak.api.ContentRepository;
 import org.apache.jackrabbit.oak.api.ContentSession;
+import org.apache.jackrabbit.oak.core.OrderedChildrenEditor;
 import org.apache.jackrabbit.oak.kernel.KernelNodeStore;
 import org.apache.jackrabbit.oak.plugins.commit.AnnotatingConflictHandler;
 import org.apache.jackrabbit.oak.plugins.commit.ConflictValidatorProvider;
@@ -67,7 +68,8 @@ public class RepositoryImpl implements R
     private static final CompositeHook DEFAULT_COMMIT_HOOK =
             new CompositeHook(
                     new ValidatingHook(DEFAULT_VALIDATOR),
-                    new PropertyIndexHook());
+                    new PropertyIndexHook(),
+                    new OrderedChildrenEditor());
 
     private static final ConflictHandler DEFAULT_CONFLICT_HANDLER = new AnnotatingConflictHandler();
 

Modified: jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java?rev=1400105&r1=1400104&r2=1400105&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java (original)
+++ jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java Fri
Oct 19 14:13:18 2012
@@ -25,6 +25,7 @@ import org.apache.jackrabbit.mk.api.Micr
 import org.apache.jackrabbit.mk.core.MicroKernelImpl;
 import org.apache.jackrabbit.oak.Oak;
 import org.apache.jackrabbit.oak.api.ContentRepository;
+import org.apache.jackrabbit.oak.core.OrderedChildrenEditor;
 import org.apache.jackrabbit.oak.http.OakServlet;
 import org.apache.jackrabbit.oak.jcr.RepositoryImpl;
 import org.apache.jackrabbit.oak.plugins.commit.ConflictValidatorProvider;
@@ -206,7 +207,8 @@ public class Main {
                     new ValidatingHook(createDefaultValidatorProvider()),
                     new PropertyIndexHook(),
                     new LuceneReindexHook(DEFAULT_INDEX_HOME),
-                    new LuceneHook(DEFAULT_INDEX_HOME));
+                    new LuceneHook(DEFAULT_INDEX_HOME),
+                    new OrderedChildrenEditor());
         }
 
         private static ValidatorProvider createDefaultValidatorProvider() {



Mime
View raw message