jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1378491 - in /jackrabbit/oak/trunk: oak-bench/base/src/main/java/org/apache/jackrabbit/oak/performance/ oak-core/src/main/java/org/apache/jackrabbit/oak/core/ oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/ oak-core/src/main/java/...
Date Wed, 29 Aug 2012 09:59:24 GMT
Author: mduerig
Date: Wed Aug 29 09:59:23 2012
New Revision: 1378491

URL: http://svn.apache.org/viewvc?rev=1378491&view=rev
Log:
OAK-285: Split CommitEditor into CommitEditor and Validator interfaces

Added:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/CommitHook.java   (contents, props changed)
      - copied, changed from r1378482, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/CommitEditor.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/CompositeHook.java
      - copied, changed from r1378482, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/CompositeEditor.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/EmptyHook.java
      - copied, changed from r1378482, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/EmptyEditor.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/ValidatingHook.java
      - copied, changed from r1378482, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/ValidatingEditor.java
Removed:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/CommitEditor.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/CompositeEditor.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/EmptyEditor.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/ValidatingEditor.java
Modified:
    jackrabbit/oak/trunk/oak-bench/base/src/main/java/org/apache/jackrabbit/oak/performance/AbstractPerformanceTest.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentRepositoryImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStore.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStoreBranch.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/osgi/Activator.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/PrefixIndex.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/PropertyIndex.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/lucene/LuceneEditor.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeStore.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/DefaultTypeEditor.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/Index.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/IndexManager.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/IndexManagerImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/NodeStoreBranch.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStoreTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/lucene/AbstractLuceneQueryTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/lucene/LuceneEditorTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/query/IndexManagerTest.java
    jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/AbstractRepositoryTest.java
    jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OakRepositoryStub.java
    jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTestUtils.java
    jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java

Modified: jackrabbit/oak/trunk/oak-bench/base/src/main/java/org/apache/jackrabbit/oak/performance/AbstractPerformanceTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-bench/base/src/main/java/org/apache/jackrabbit/oak/performance/AbstractPerformanceTest.java?rev=1378491&r1=1378490&r2=1378491&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-bench/base/src/main/java/org/apache/jackrabbit/oak/performance/AbstractPerformanceTest.java (original)
+++ jackrabbit/oak/trunk/oak-bench/base/src/main/java/org/apache/jackrabbit/oak/performance/AbstractPerformanceTest.java Wed Aug 29 09:59:23 2012
@@ -37,7 +37,7 @@ import org.apache.jackrabbit.oak.api.Con
 import org.apache.jackrabbit.oak.core.ContentRepositoryImpl;
 import org.apache.jackrabbit.oak.jcr.RepositoryImpl;
 import org.apache.jackrabbit.oak.spi.commit.CompositeValidatorProvider;
-import org.apache.jackrabbit.oak.spi.commit.ValidatingEditor;
+import org.apache.jackrabbit.oak.spi.commit.ValidatingHook;
 import org.apache.jackrabbit.oak.spi.commit.ValidatorProvider;
 
 /**
@@ -175,7 +175,7 @@ public abstract class AbstractPerformanc
         // return new RepositoryImpl();
 
         mk = new IndexWrapper(mk);
-        ValidatingEditor ve =  new ValidatingEditor(
+        ValidatingHook ve =  new ValidatingHook(
                 new CompositeValidatorProvider(Collections.<ValidatorProvider>emptyList()));
         ContentRepository contentRepository = new ContentRepositoryImpl(mk, null, ve);
         return new RepositoryImpl(contentRepository, null);

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentRepositoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentRepositoryImpl.java?rev=1378491&r1=1378490&r2=1378491&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentRepositoryImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentRepositoryImpl.java Wed Aug 29 09:59:23 2012
@@ -26,17 +26,17 @@ import javax.security.auth.login.LoginEx
 
 import org.apache.jackrabbit.mk.api.MicroKernel;
 import org.apache.jackrabbit.mk.core.MicroKernelImpl;
-import org.apache.jackrabbit.oak.plugins.index.Indexer;
 import org.apache.jackrabbit.oak.api.ContentRepository;
 import org.apache.jackrabbit.oak.api.ContentSession;
 import org.apache.jackrabbit.oak.kernel.KernelNodeStore;
+import org.apache.jackrabbit.oak.plugins.index.Indexer;
 import org.apache.jackrabbit.oak.query.QueryEngineImpl;
 import org.apache.jackrabbit.oak.security.authentication.LoginContextProviderImpl;
 import org.apache.jackrabbit.oak.security.authorization.AccessControlContextImpl;
 import org.apache.jackrabbit.oak.spi.QueryIndexProvider;
-import org.apache.jackrabbit.oak.spi.commit.CommitEditor;
+import org.apache.jackrabbit.oak.spi.commit.CommitHook;
 import org.apache.jackrabbit.oak.spi.commit.CompositeValidatorProvider;
-import org.apache.jackrabbit.oak.spi.commit.ValidatingEditor;
+import org.apache.jackrabbit.oak.spi.commit.ValidatingHook;
 import org.apache.jackrabbit.oak.spi.commit.ValidatorProvider;
 import org.apache.jackrabbit.oak.spi.security.authentication.LoginContextProvider;
 import org.apache.jackrabbit.oak.spi.security.authorization.AccessControlContext;
@@ -67,7 +67,7 @@ public class ContentRepositoryImpl imple
      * test cases only.
      */
     public ContentRepositoryImpl() {
-        this(new MicroKernelImpl(), null, new ValidatingEditor(
+        this(new MicroKernelImpl(), null, new ValidatingHook(
                 new CompositeValidatorProvider(
                         Collections.<ValidatorProvider> emptyList())));
         // this(new IndexWrapper(new MicroKernelImpl()), null, null);
@@ -89,7 +89,7 @@ public class ContentRepositoryImpl imple
     public ContentRepositoryImpl(MicroKernel microKernel,
             QueryIndexProvider indexProvider,
             ValidatorProvider validatorProvider) {
-        this(microKernel, indexProvider, new ValidatingEditor(
+        this(microKernel, indexProvider, new ValidatingHook(
                 validatorProvider != null ? validatorProvider
                         : new CompositeValidatorProvider(
                                 Collections.<ValidatorProvider> emptyList())));
@@ -101,13 +101,13 @@ public class ContentRepositoryImpl imple
      *
      * @param microKernel underlying kernel instance
      * @param indexProvider index provider
-     * @param commitEditor the commit editor
+     * @param commitHook the commit hook
      */
     public ContentRepositoryImpl(MicroKernel microKernel, QueryIndexProvider indexProvider,
-                                 CommitEditor commitEditor) {
+                                 CommitHook commitHook) {
 
         nodeStore = new KernelNodeStore(microKernel);
-        nodeStore.setEditor(commitEditor);
+        nodeStore.setHook(commitHook);
 
         QueryIndexProvider qip = (indexProvider == null) ? getDefaultIndexProvider(microKernel) : indexProvider;
         queryEngine = new QueryEngineImpl(nodeStore, microKernel, qip);

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java?rev=1378491&r1=1378490&r2=1378491&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java Wed Aug 29 09:59:23 2012
@@ -31,9 +31,9 @@ import org.apache.jackrabbit.oak.api.Roo
 import org.apache.jackrabbit.oak.api.TreeLocation;
 import org.apache.jackrabbit.oak.security.privilege.PrivilegeValidatorProvider;
 import org.apache.jackrabbit.oak.security.user.UserValidatorProvider;
-import org.apache.jackrabbit.oak.spi.commit.CommitEditor;
+import org.apache.jackrabbit.oak.spi.commit.CommitHook;
 import org.apache.jackrabbit.oak.spi.commit.CompositeValidatorProvider;
-import org.apache.jackrabbit.oak.spi.commit.ValidatingEditor;
+import org.apache.jackrabbit.oak.spi.commit.ValidatingHook;
 import org.apache.jackrabbit.oak.spi.commit.ValidatorProvider;
 import org.apache.jackrabbit.oak.spi.security.authorization.AccessControlContext;
 import org.apache.jackrabbit.oak.spi.security.authorization.CompiledPermissions;
@@ -63,7 +63,7 @@ public class RootImpl implements Root {
     private final AccessControlContext accessControlContext;
     private CompiledPermissions permissions;
 
-    private final CommitEditor commitEditor;
+    private final CommitHook commitHook;
 
     /** Current branch this root operates on */
     private NodeStoreBranch branch;
@@ -107,7 +107,7 @@ public class RootImpl implements Root {
     public RootImpl(NodeStore store, String workspaceName, AccessControlContext accessControlContext) {
         this.store = store;
         this.accessControlContext = accessControlContext;
-        this.commitEditor = createCommitEditor();
+        this.commitHook = createCommitHook();
         refresh();
     }
 
@@ -172,7 +172,7 @@ public class RootImpl implements Root {
     public void commit(ConflictHandler conflictHandler) throws CommitFailedException {
         rebase(conflictHandler);
         purgePendingChanges();
-        branch.merge(commitEditor);
+        branch.merge(commitHook);
         refresh();
     }
 
@@ -253,7 +253,7 @@ public class RootImpl implements Root {
         }
     }
 
-    private CommitEditor createCommitEditor() {
+    private CommitHook createCommitHook() {
         CoreValueFactory valueFactory = store.getValueFactory();
         List<ValidatorProvider> providers = new ArrayList<ValidatorProvider>();
 
@@ -265,6 +265,6 @@ public class RootImpl implements Root {
         providers.add(new UserValidatorProvider(valueFactory, new UserConfig("admin")));
         providers.add(new PrivilegeValidatorProvider(valueFactory));
 
-        return new ValidatingEditor(new CompositeValidatorProvider(providers));
+        return new ValidatingHook(new CompositeValidatorProvider(providers));
     }
 }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStore.java?rev=1378491&r1=1378490&r2=1378491&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStore.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStore.java Wed Aug 29 09:59:23 2012
@@ -21,8 +21,8 @@ import javax.annotation.Nonnull;
 import org.apache.jackrabbit.mk.api.MicroKernel;
 import org.apache.jackrabbit.oak.api.CoreValueFactory;
 import org.apache.jackrabbit.oak.plugins.memory.MemoryNodeBuilder;
-import org.apache.jackrabbit.oak.spi.commit.CommitEditor;
-import org.apache.jackrabbit.oak.spi.commit.EmptyEditor;
+import org.apache.jackrabbit.oak.spi.commit.CommitHook;
+import org.apache.jackrabbit.oak.spi.commit.EmptyHook;
 import org.apache.jackrabbit.oak.spi.commit.EmptyObserver;
 import org.apache.jackrabbit.oak.spi.commit.Observer;
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
@@ -41,10 +41,10 @@ public class KernelNodeStore implements 
     private final MicroKernel kernel;
 
     /**
-     * Commit editor.
+     * Commit hook.
      */
     @Nonnull
-    private volatile CommitEditor editor = EmptyEditor.INSTANCE;
+    private volatile CommitHook hook = EmptyHook.INSTANCE;
 
     /**
      * Change observer.
@@ -64,13 +64,13 @@ public class KernelNodeStore implements 
     }
 
     @Nonnull
-    public CommitEditor getEditor() {
-        return editor;
+    public CommitHook getHook() {
+        return hook;
     }
 
-    public void setEditor(CommitEditor editor) {
-        assert editor != null;
-        this.editor = editor;
+    public void setHook(CommitHook hook) {
+        assert hook != null;
+        this.hook = hook;
     }
 
     @Nonnull

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStoreBranch.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStoreBranch.java?rev=1378491&r1=1378490&r2=1378491&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStoreBranch.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStoreBranch.java Wed Aug 29 09:59:23 2012
@@ -19,8 +19,8 @@ package org.apache.jackrabbit.oak.kernel
 import org.apache.jackrabbit.mk.api.MicroKernel;
 import org.apache.jackrabbit.mk.api.MicroKernelException;
 import org.apache.jackrabbit.oak.api.CommitFailedException;
-import org.apache.jackrabbit.oak.spi.commit.CommitEditor;
-import org.apache.jackrabbit.oak.spi.commit.CompositeEditor;
+import org.apache.jackrabbit.oak.spi.commit.CommitHook;
+import org.apache.jackrabbit.oak.spi.commit.CompositeHook;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
 import org.apache.jackrabbit.oak.spi.state.NodeStoreBranch;
 
@@ -123,12 +123,12 @@ class KernelNodeStoreBranch implements N
     }
 
     @Override
-    public NodeState merge(CommitEditor editor) throws CommitFailedException {
+    public NodeState merge(CommitHook hook) throws CommitFailedException {
         NodeState oldRoot = base;
-        CommitEditor commitEditor = editor == null
-                ? store.getEditor()
-                : new CompositeEditor(store.getEditor(), editor);
-        NodeState toCommit = commitEditor.editCommit(store, oldRoot, currentRoot);
+        CommitHook commitHook = hook == null
+                ? store.getHook()
+                : new CompositeHook(store.getHook(), hook);
+        NodeState toCommit = commitHook.processCommit(store, oldRoot, currentRoot);
         setRoot(toCommit);
 
         try {

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/osgi/Activator.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/osgi/Activator.java?rev=1378491&r1=1378490&r2=1378491&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/osgi/Activator.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/osgi/Activator.java Wed Aug 29 09:59:23 2012
@@ -26,9 +26,9 @@ import org.apache.jackrabbit.mk.api.Micr
 import org.apache.jackrabbit.oak.api.ContentRepository;
 import org.apache.jackrabbit.oak.core.ContentRepositoryImpl;
 import org.apache.jackrabbit.oak.plugins.type.DefaultTypeEditor;
-import org.apache.jackrabbit.oak.spi.commit.CommitEditor;
-import org.apache.jackrabbit.oak.spi.commit.CompositeEditor;
-import org.apache.jackrabbit.oak.spi.commit.ValidatingEditor;
+import org.apache.jackrabbit.oak.spi.commit.CommitHook;
+import org.apache.jackrabbit.oak.spi.commit.CompositeHook;
+import org.apache.jackrabbit.oak.spi.commit.ValidatingHook;
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
@@ -77,16 +77,16 @@ public class Activator implements Bundle
     public Object addingService(ServiceReference reference) {
         Object service = context.getService(reference);
         if (service instanceof MicroKernel) {
-            List<CommitEditor> editors = new ArrayList<CommitEditor>();
-            editors.add(new DefaultTypeEditor());
-            editors.add(new ValidatingEditor(validatorProvider));
-            // editors.add(new LuceneEditor());
+            List<CommitHook> hooks = new ArrayList<CommitHook>();
+            hooks.add(new DefaultTypeEditor());
+            hooks.add(new ValidatingHook(validatorProvider));
+            // hooks.add(new LuceneEditor());
 
             MicroKernel kernel = (MicroKernel) service;
             services.put(reference, context.registerService(
                     ContentRepository.class.getName(),
                     new ContentRepositoryImpl(
-                            kernel, indexProvider, new CompositeEditor(editors)),
+                            kernel, indexProvider, new CompositeHook(hooks)),
                     new Properties()));
             return service;
         } else {

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/PrefixIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/PrefixIndex.java?rev=1378491&r1=1378490&r2=1378491&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/PrefixIndex.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/PrefixIndex.java Wed Aug 29 09:59:23 2012
@@ -150,7 +150,7 @@ public class PrefixIndex implements PInd
     }
 
     @Override
-    public NodeState editCommit(NodeStore store, NodeState before,
+    public NodeState processCommit(NodeStore store, NodeState before,
             NodeState after) throws CommitFailedException {
         // TODO Auto-generated method stub
         return null;

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/PropertyIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/PropertyIndex.java?rev=1378491&r1=1378490&r2=1378491&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/PropertyIndex.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/PropertyIndex.java Wed Aug 29 09:59:23 2012
@@ -151,7 +151,7 @@ public class PropertyIndex implements PI
     }
 
     @Override
-    public NodeState editCommit(NodeStore store, NodeState before,
+    public NodeState processCommit(NodeStore store, NodeState before,
             NodeState after) throws CommitFailedException {
         // TODO Auto-generated method stub
         return null;

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/lucene/LuceneEditor.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/lucene/LuceneEditor.java?rev=1378491&r1=1378490&r2=1378491&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/lucene/LuceneEditor.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/lucene/LuceneEditor.java Wed Aug 29 09:59:23 2012
@@ -16,14 +16,6 @@
  */
 package org.apache.jackrabbit.oak.plugins.lucene;
 
-import static org.apache.jackrabbit.oak.plugins.lucene.FieldFactory.newPathField;
-import static org.apache.jackrabbit.oak.plugins.lucene.FieldFactory.newPropertyField;
-import static org.apache.jackrabbit.oak.spi.query.IndexUtils.DEFAULT_INDEX_HOME;
-import static org.apache.jackrabbit.oak.plugins.lucene.LuceneIndexUtils.DEFAULT_INDEX_NAME;
-import static org.apache.jackrabbit.oak.plugins.lucene.LuceneIndexUtils.INDEX_DATA_CHILD_NAME;
-import static org.apache.jackrabbit.oak.plugins.lucene.TermFactory.newPathTerm;
-import static org.apache.jackrabbit.oak.spi.query.IndexUtils.split;
-
 import java.io.IOException;
 
 import javax.jcr.PropertyType;
@@ -32,7 +24,7 @@ import org.apache.jackrabbit.oak.api.Com
 import org.apache.jackrabbit.oak.api.CoreValue;
 import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.commons.PathUtils;
-import org.apache.jackrabbit.oak.spi.commit.CommitEditor;
+import org.apache.jackrabbit.oak.spi.commit.CommitHook;
 import org.apache.jackrabbit.oak.spi.query.Index;
 import org.apache.jackrabbit.oak.spi.query.IndexDefinition;
 import org.apache.jackrabbit.oak.spi.query.IndexDefinitionImpl;
@@ -50,10 +42,18 @@ import org.apache.lucene.util.Version;
 import org.apache.tika.Tika;
 import org.apache.tika.exception.TikaException;
 
+import static org.apache.jackrabbit.oak.plugins.lucene.FieldFactory.newPathField;
+import static org.apache.jackrabbit.oak.plugins.lucene.FieldFactory.newPropertyField;
+import static org.apache.jackrabbit.oak.plugins.lucene.LuceneIndexUtils.DEFAULT_INDEX_NAME;
+import static org.apache.jackrabbit.oak.plugins.lucene.LuceneIndexUtils.INDEX_DATA_CHILD_NAME;
+import static org.apache.jackrabbit.oak.plugins.lucene.TermFactory.newPathTerm;
+import static org.apache.jackrabbit.oak.spi.query.IndexUtils.DEFAULT_INDEX_HOME;
+import static org.apache.jackrabbit.oak.spi.query.IndexUtils.split;
+
 /**
  * This class updates a Lucene index when node content is changed.
  */
-public class LuceneEditor implements CommitEditor, Index {
+public class LuceneEditor implements CommitHook, Index {
 
     private static final Tika TIKA = new Tika();
 
@@ -94,7 +94,7 @@ public class LuceneEditor implements Com
     }
 
     @Override
-    public NodeState editCommit(NodeStore store, NodeState before,
+    public NodeState processCommit(NodeStore store, NodeState before,
             NodeState after) throws CommitFailedException {
         try {
             OakDirectory directory = new OakDirectory(store, after, path);

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeStore.java?rev=1378491&r1=1378490&r2=1378491&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeStore.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeStore.java Wed Aug 29 09:59:23 2012
@@ -20,7 +20,7 @@ import java.util.concurrent.atomic.Atomi
 
 import org.apache.jackrabbit.oak.api.CommitFailedException;
 import org.apache.jackrabbit.oak.api.CoreValueFactory;
-import org.apache.jackrabbit.oak.spi.commit.CommitEditor;
+import org.apache.jackrabbit.oak.spi.commit.CommitHook;
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
 import org.apache.jackrabbit.oak.spi.state.NodeStore;
@@ -82,7 +82,7 @@ public class MemoryNodeStore implements 
         }
 
         @Override
-        public NodeState merge(CommitEditor editor) throws CommitFailedException {
+        public NodeState merge(CommitHook hook) throws CommitFailedException {
             while (!MemoryNodeStore.this.root.compareAndSet(base, root)) {
                 // TODO: rebase();
                 throw new UnsupportedOperationException();

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/DefaultTypeEditor.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/DefaultTypeEditor.java?rev=1378491&r1=1378490&r2=1378491&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/DefaultTypeEditor.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/DefaultTypeEditor.java Wed Aug 29 09:59:23 2012
@@ -20,7 +20,7 @@ import javax.jcr.PropertyType;
 
 import org.apache.jackrabbit.oak.api.CommitFailedException;
 import org.apache.jackrabbit.oak.api.CoreValue;
-import org.apache.jackrabbit.oak.spi.commit.CommitEditor;
+import org.apache.jackrabbit.oak.spi.commit.CommitHook;
 import org.apache.jackrabbit.oak.spi.state.ChildNodeEntry;
 import org.apache.jackrabbit.oak.spi.state.DefaultNodeStateDiff;
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
@@ -31,10 +31,10 @@ import org.apache.jackrabbit.oak.spi.sta
 /**
  * This class updates a Lucene index when node content is changed.
  */
-public class DefaultTypeEditor implements CommitEditor {
+public class DefaultTypeEditor implements CommitHook {
 
     @Override
-    public NodeState editCommit(
+    public NodeState processCommit(
             NodeStore store, NodeState before, NodeState after)
             throws CommitFailedException {
         // TODO: Calculate default type from the node definition

Copied: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/CommitHook.java (from r1378482, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/CommitEditor.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/CommitHook.java?p2=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/CommitHook.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/CommitEditor.java&r1=1378482&r2=1378491&rev=1378491&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/CommitEditor.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/CommitHook.java Wed Aug 29 09:59:23 2012
@@ -16,18 +16,18 @@
  */
 package org.apache.jackrabbit.oak.spi.commit;
 
+import javax.annotation.Nonnull;
+
 import org.apache.jackrabbit.oak.api.CommitFailedException;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
 import org.apache.jackrabbit.oak.spi.state.NodeStore;
 
-import javax.annotation.Nonnull;
-
 /**
  * Extension point for validating and modifying content changes. Available
- * commit editors are called in sequence to process incoming content changes
+ * commit hooks are called in sequence to process incoming content changes
  * before they get persisted and shared with other clients.
  * <p>
- * A commit editor can throw a {@link CommitFailedException} for a particular
+ * A commit hook can throw a {@link CommitFailedException} for a particular
  * change to prevent it from being persisted, or it can modify the changes
  * for example to update an in-content index or to add auto-generated content.
  * <p>
@@ -35,7 +35,7 @@ import javax.annotation.Nonnull;
  * editors and validators are better expressed as implementations of the
  * more specific extension interfaces defined in this package.
  */
-public interface CommitEditor {
+public interface CommitHook {
 
     /**
      * Validates and/or modifies the given content change before it gets
@@ -48,7 +48,7 @@ public interface CommitEditor {
      * @throws CommitFailedException if the commit should be rejected
      */
     @Nonnull
-    NodeState editCommit(NodeStore store, NodeState before, NodeState after)
+    NodeState processCommit(NodeStore store, NodeState before, NodeState after)
         throws CommitFailedException;
 
 }

Propchange: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/CommitHook.java
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/CompositeHook.java (from r1378482, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/CompositeEditor.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/CompositeHook.java?p2=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/CompositeHook.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/CompositeEditor.java&r1=1378482&r2=1378491&rev=1378491&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/CompositeEditor.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/CompositeHook.java Wed Aug 29 09:59:23 2012
@@ -16,38 +16,38 @@
  */
 package org.apache.jackrabbit.oak.spi.commit;
 
+import java.util.Arrays;
+import java.util.List;
+
 import org.apache.jackrabbit.oak.api.CommitFailedException;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
 import org.apache.jackrabbit.oak.spi.state.NodeStore;
 
-import java.util.Arrays;
-import java.util.List;
-
 /**
- * Composite commit editor. Maintains a list of component editors and takes
+ * Composite commit hook. Maintains a list of component hooks and takes
  * care of calling them in proper sequence in the
- * {@link #editCommit(NodeStore, NodeState, NodeState)} method.
+ * {@link #processCommit(NodeStore, NodeState, NodeState)} method.
  */
-public class CompositeEditor implements CommitEditor {
+public class CompositeHook implements CommitHook {
 
-    private final List<CommitEditor> editors;
+    private final List<CommitHook> hooks;
 
-    public CompositeEditor(List<CommitEditor> editors) {
-        this.editors = editors;
+    public CompositeHook(List<CommitHook> hooks) {
+        this.hooks = hooks;
     }
 
-    public CompositeEditor(CommitEditor... editors) {
-        this(Arrays.asList(editors));
+    public CompositeHook(CommitHook... hooks) {
+        this(Arrays.asList(hooks));
     }
 
     @Override
-    public NodeState editCommit(
+    public NodeState processCommit(
             NodeStore store, NodeState before, NodeState after)
             throws CommitFailedException {
 
         NodeState newState = after;
-        for (CommitEditor editor : editors) {
-            newState = editor.editCommit(store, before, newState);
+        for (CommitHook hook : hooks) {
+            newState = hook.processCommit(store, before, newState);
         }
 
         return newState;

Copied: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/EmptyHook.java (from r1378482, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/EmptyEditor.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/EmptyHook.java?p2=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/EmptyHook.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/EmptyEditor.java&r1=1378482&r2=1378491&rev=1378491&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/EmptyEditor.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/EmptyHook.java Wed Aug 29 09:59:23 2012
@@ -29,21 +29,21 @@ import org.apache.jackrabbit.oak.spi.sta
  * the need for extra code for such cases.</li>
  * <li>Other commit hook implementations can extend this class and gain
  * improved forwards-compatibility to possible changes in the
- * {@link CommitEditor} interface. For example if it is later decided that
+ * {@link CommitHook} interface. For example if it is later decided that
  * new arguments are needed in the hook methods, this class is guaranteed
  * to implement any new method signatures in a way that falls gracefully
  * back to any earlier behavior.</li>
  * </ol>
  */
-public class EmptyEditor implements CommitEditor {
+public class EmptyHook implements CommitHook {
 
     /**
      * Static instance of this class, useful as a "null object".
      */
-    public static final CommitEditor INSTANCE = new EmptyEditor();
+    public static final CommitHook INSTANCE = new EmptyHook();
 
     @Override
-    public NodeState editCommit(
+    public NodeState processCommit(
             NodeStore store, NodeState before, NodeState after)
             throws CommitFailedException {
         return after;

Copied: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/ValidatingHook.java (from r1378482, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/ValidatingEditor.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/ValidatingHook.java?p2=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/ValidatingHook.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/ValidatingEditor.java&r1=1378482&r2=1378491&rev=1378491&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/ValidatingEditor.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/ValidatingHook.java Wed Aug 29 09:59:23 2012
@@ -25,11 +25,11 @@ import org.apache.jackrabbit.oak.spi.sta
 import static org.apache.jackrabbit.oak.plugins.memory.MemoryNodeState.EMPTY_NODE;
 
 /**
- * This commit editor implementation validates the changes to be committed
+ * This commit hook implementation validates the changes to be committed
  * against all {@link Validator}s provided by the {@link ValidatorProvider}
  * passed to the class' constructor.
  */
-public class ValidatingEditor implements CommitEditor {
+public class ValidatingHook implements CommitHook {
 
     private final ValidatorProvider validatorProvider;
 
@@ -38,12 +38,12 @@ public class ValidatingEditor implements
      * {@link Validator}s provided by {@code validatorProvider}.
      * @param validatorProvider  validator provider
      */
-    public ValidatingEditor(ValidatorProvider validatorProvider) {
+    public ValidatingHook(ValidatorProvider validatorProvider) {
         this.validatorProvider = validatorProvider;
     }
 
     @Override
-    public NodeState editCommit(
+    public NodeState processCommit(
             NodeStore store, NodeState before, NodeState after)
             throws CommitFailedException {
         Validator validator = validatorProvider.getRootValidator(before, after);

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/Index.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/Index.java?rev=1378491&r1=1378490&r2=1378491&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/Index.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/Index.java Wed Aug 29 09:59:23 2012
@@ -20,14 +20,14 @@ import java.io.Closeable;
 
 import javax.annotation.Nonnull;
 
-import org.apache.jackrabbit.oak.spi.commit.CommitEditor;
+import org.apache.jackrabbit.oak.spi.commit.CommitHook;
 
 /**
  * An index is a lookup mechanism. It typically uses a tree to store data. It
  * updates the tree whenever a node was changed. The index is updated
  * automatically.
  */
-public interface Index extends CommitEditor, Closeable {
+public interface Index extends CommitHook, Closeable {
 
     /**
      * Get the the index definition. This contains the name, type, uniqueness

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/IndexManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/IndexManager.java?rev=1378491&r1=1378490&r2=1378491&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/IndexManager.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/IndexManager.java Wed Aug 29 09:59:23 2012
@@ -22,7 +22,7 @@ import java.util.List;
 import javax.annotation.CheckForNull;
 import javax.annotation.Nonnull;
 
-import org.apache.jackrabbit.oak.spi.commit.CommitEditor;
+import org.apache.jackrabbit.oak.spi.commit.CommitHook;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
 
 /**
@@ -40,7 +40,7 @@ import org.apache.jackrabbit.oak.spi.sta
  * </p>
  * </p>
  */
-public interface IndexManager extends CommitEditor, Closeable {
+public interface IndexManager extends CommitHook, Closeable {
 
     void registerIndexFactory(IndexFactory... factory);
 
@@ -56,7 +56,7 @@ public interface IndexManager extends Co
      * @return the index with the given definition
      */
     @CheckForNull
-    public Index getIndex(IndexDefinition definition);
+    Index getIndex(IndexDefinition definition);
 
     /**
      * @return the existing index definitions

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/IndexManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/IndexManagerImpl.java?rev=1378491&r1=1378490&r2=1378491&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/IndexManagerImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/query/IndexManagerImpl.java Wed Aug 29 09:59:23 2012
@@ -26,14 +26,14 @@ import java.util.concurrent.ConcurrentHa
 
 import org.apache.jackrabbit.mk.api.MicroKernel;
 import org.apache.jackrabbit.oak.api.CommitFailedException;
-import org.apache.jackrabbit.oak.spi.commit.CommitEditor;
+import org.apache.jackrabbit.oak.spi.commit.CommitHook;
 import org.apache.jackrabbit.oak.spi.state.ChildNodeEntry;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
 import org.apache.jackrabbit.oak.spi.state.NodeStore;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class IndexManagerImpl implements IndexManager, CommitEditor {
+public class IndexManagerImpl implements IndexManager, CommitHook {
 
     private static final Logger LOG = LoggerFactory
             .getLogger(IndexManagerImpl.class);
@@ -155,7 +155,7 @@ public class IndexManagerImpl implements
     }
 
     @Override
-    public NodeState editCommit(NodeStore store, NodeState before,
+    public NodeState processCommit(NodeStore store, NodeState before,
             NodeState after) throws CommitFailedException {
 
         NodeState newState = after;
@@ -165,7 +165,7 @@ public class IndexManagerImpl implements
             if (index == null) {
                 continue;
             }
-            newState = index.editCommit(store, before, newState);
+            newState = index.processCommit(store, before, newState);
         }
         return newState;
     }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/NodeStoreBranch.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/NodeStoreBranch.java?rev=1378491&r1=1378490&r2=1378491&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/NodeStoreBranch.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/NodeStoreBranch.java Wed Aug 29 09:59:23 2012
@@ -19,7 +19,7 @@ package org.apache.jackrabbit.oak.spi.st
 import javax.annotation.Nonnull;
 
 import org.apache.jackrabbit.oak.api.CommitFailedException;
-import org.apache.jackrabbit.oak.spi.commit.CommitEditor;
+import org.apache.jackrabbit.oak.spi.commit.CommitHook;
 
 public interface NodeStoreBranch {
 
@@ -66,13 +66,13 @@ public interface NodeStoreBranch {
 
     /**
      * Merges the changes in this branch to the main content tree.
-     * @param editor  commit editor to apply
+     * @param hook  commit hook to apply
      * @return the node state resulting from the merge.
      *
      * @throws CommitFailedException if the merge failed
      */
     @Nonnull
-    NodeState merge(CommitEditor editor) throws CommitFailedException;
+    NodeState merge(CommitHook hook) throws CommitFailedException;
 
 }
 

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStoreTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStoreTest.java?rev=1378491&r1=1378490&r2=1378491&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStoreTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStoreTest.java Wed Aug 29 09:59:23 2012
@@ -23,8 +23,8 @@ import org.apache.jackrabbit.mk.core.Mic
 import org.apache.jackrabbit.oak.api.CommitFailedException;
 import org.apache.jackrabbit.oak.api.CoreValue;
 import org.apache.jackrabbit.oak.plugins.memory.MemoryNodeState;
-import org.apache.jackrabbit.oak.spi.commit.CommitEditor;
-import org.apache.jackrabbit.oak.spi.commit.EmptyEditor;
+import org.apache.jackrabbit.oak.spi.commit.CommitHook;
+import org.apache.jackrabbit.oak.spi.commit.EmptyHook;
 import org.apache.jackrabbit.oak.spi.commit.Observer;
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
@@ -105,7 +105,7 @@ public class KernelNodeStoreTest {
         assertNull(testState.getChildNode("newNode"));
         assertNotNull(testState.getChildNode("x"));
 
-        branch.merge(EmptyEditor.INSTANCE);
+        branch.merge(EmptyHook.INSTANCE);
 
         // Assert changes are present in the trunk
         testState = store.getRoot().getChildNode("test");
@@ -140,7 +140,7 @@ public class KernelNodeStoreTest {
 
         NodeStoreBranch branch = store.branch();
         branch.setRoot(newRoot);
-        branch.merge(EmptyEditor.INSTANCE);
+        branch.merge(EmptyHook.INSTANCE);
         store.getRoot(); // triggers the observer
 
         NodeState before = states[0];
@@ -157,9 +157,9 @@ public class KernelNodeStoreTest {
 
     @Test
     public void beforeCommitHook() throws CommitFailedException {
-        store.setEditor(new CommitEditor() {
+        store.setHook(new CommitHook() {
             @Override
-            public NodeState editCommit(
+            public NodeState processCommit(
                     NodeStore store, NodeState before, NodeState after) {
                 NodeBuilder rootBuilder = store.getBuilder(after);
                 NodeBuilder testBuilder = store.getBuilder(after.getChildNode("test"));
@@ -183,7 +183,7 @@ public class KernelNodeStoreTest {
 
         NodeStoreBranch branch = store.branch();
         branch.setRoot(newRoot);
-        branch.merge(EmptyEditor.INSTANCE);
+        branch.merge(EmptyHook.INSTANCE);
 
         NodeState test = store.getRoot().getChildNode("test");
         assertNotNull(test.getChildNode("newNode"));

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/lucene/AbstractLuceneQueryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/lucene/AbstractLuceneQueryTest.java?rev=1378491&r1=1378490&r2=1378491&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/lucene/AbstractLuceneQueryTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/lucene/AbstractLuceneQueryTest.java Wed Aug 29 09:59:23 2012
@@ -16,10 +16,6 @@
  */
 package org.apache.jackrabbit.oak.plugins.lucene;
 
-import static org.apache.jackrabbit.oak.plugins.lucene.LuceneIndexUtils.DEFAULT_INDEX_NAME;
-import static org.apache.jackrabbit.oak.plugins.lucene.LuceneIndexUtils.createIndexNode;
-import static org.apache.jackrabbit.oak.spi.query.IndexUtils.DEFAULT_INDEX_HOME;
-
 import java.text.ParseException;
 import java.util.ArrayList;
 import java.util.List;
@@ -43,16 +39,20 @@ import org.apache.jackrabbit.oak.plugins
 import org.apache.jackrabbit.oak.plugins.type.DefaultTypeEditor;
 import org.apache.jackrabbit.oak.plugins.type.TypeValidatorProvider;
 import org.apache.jackrabbit.oak.plugins.value.ConflictValidatorProvider;
-import org.apache.jackrabbit.oak.spi.commit.CommitEditor;
-import org.apache.jackrabbit.oak.spi.commit.CompositeEditor;
+import org.apache.jackrabbit.oak.spi.commit.CommitHook;
+import org.apache.jackrabbit.oak.spi.commit.CompositeHook;
 import org.apache.jackrabbit.oak.spi.commit.CompositeValidatorProvider;
-import org.apache.jackrabbit.oak.spi.commit.ValidatingEditor;
+import org.apache.jackrabbit.oak.spi.commit.ValidatingHook;
 import org.apache.jackrabbit.oak.spi.commit.ValidatorProvider;
 import org.apache.jackrabbit.oak.spi.query.IndexManager;
 import org.apache.jackrabbit.oak.spi.query.IndexManagerImpl;
 import org.apache.jackrabbit.oak.spi.query.IndexUtils;
 import org.junit.Before;
 
+import static org.apache.jackrabbit.oak.plugins.lucene.LuceneIndexUtils.DEFAULT_INDEX_NAME;
+import static org.apache.jackrabbit.oak.plugins.lucene.LuceneIndexUtils.createIndexNode;
+import static org.apache.jackrabbit.oak.spi.query.IndexUtils.DEFAULT_INDEX_HOME;
+
 /**
  * base class for lucene search tests
  */
@@ -68,6 +68,7 @@ public abstract class AbstractLuceneQuer
     protected SessionQueryEngine qe;
     protected Root root;
 
+    @Override
     @Before
     public void before() throws Exception {
         super.before();
@@ -83,18 +84,18 @@ public abstract class AbstractLuceneQuer
     protected ContentRepository createRepository() {
         mk = new MicroKernelImpl();
         return new ContentRepositoryImpl(mk, new LuceneIndexProvider(
-                DEFAULT_INDEX_HOME), buildDefaultCommitEditor());
+                DEFAULT_INDEX_HOME), buildDefaultCommitHook());
     }
 
-    private CommitEditor buildDefaultCommitEditor() {
+    private CommitHook buildDefaultCommitHook() {
         IndexManager im = new IndexManagerImpl(IndexUtils.DEFAULT_INDEX_HOME,
                 mk, new PropertyIndexFactory(), new LuceneIndexFactory());
 
-        List<CommitEditor> editors = new ArrayList<CommitEditor>();
-        editors.add(new DefaultTypeEditor());
-        editors.add(new ValidatingEditor(createDefaultValidatorProvider()));
-        editors.add(im);
-        return new CompositeEditor(editors);
+        List<CommitHook> hooks = new ArrayList<CommitHook>();
+        hooks.add(new DefaultTypeEditor());
+        hooks.add(new ValidatingHook(createDefaultValidatorProvider()));
+        hooks.add(im);
+        return new CompositeHook(hooks);
     }
 
     private static ValidatorProvider createDefaultValidatorProvider() {

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/lucene/LuceneEditorTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/lucene/LuceneEditorTest.java?rev=1378491&r1=1378490&r2=1378491&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/lucene/LuceneEditorTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/lucene/LuceneEditorTest.java Wed Aug 29 09:59:23 2012
@@ -16,12 +16,6 @@
  */
 package org.apache.jackrabbit.oak.plugins.lucene;
 
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertTrue;
-import static org.apache.jackrabbit.oak.plugins.lucene.LuceneIndexUtils.DEFAULT_INDEX_NAME;
-import static org.apache.jackrabbit.oak.spi.query.IndexUtils.DEFAULT_INDEX_HOME;
-
 import org.apache.jackrabbit.mk.core.MicroKernelImpl;
 import org.apache.jackrabbit.oak.api.Root;
 import org.apache.jackrabbit.oak.api.Tree;
@@ -39,6 +33,12 @@ import org.apache.jackrabbit.oak.spi.que
 import org.apache.jackrabbit.oak.spi.query.IndexDefinitionImpl;
 import org.junit.Test;
 
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertFalse;
+import static junit.framework.Assert.assertTrue;
+import static org.apache.jackrabbit.oak.plugins.lucene.LuceneIndexUtils.DEFAULT_INDEX_NAME;
+import static org.apache.jackrabbit.oak.spi.query.IndexUtils.DEFAULT_INDEX_HOME;
+
 public class LuceneEditorTest {
 
     @Test
@@ -47,7 +47,7 @@ public class LuceneEditorTest {
                 LuceneIndexFactory.TYPE, DEFAULT_INDEX_HOME, false, null);
 
         KernelNodeStore store = new KernelNodeStore(new MicroKernelImpl());
-        store.setEditor(new LuceneEditor(testID));
+        store.setHook(new LuceneEditor(testID));
         Root root = new RootImpl(store, "", new TestAcContext());
         Tree tree = root.getTree("/");
 

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/query/IndexManagerTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/query/IndexManagerTest.java?rev=1378491&r1=1378490&r2=1378491&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/query/IndexManagerTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/spi/query/IndexManagerTest.java Wed Aug 29 09:59:23 2012
@@ -16,10 +16,6 @@
  */
 package org.apache.jackrabbit.oak.spi.query;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
 import java.io.IOException;
 import java.util.Arrays;
 
@@ -41,6 +37,10 @@ import org.apache.jackrabbit.oak.spi.sta
 import org.junit.Before;
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
 public class IndexManagerTest extends AbstractOakTest {
 
     protected ContentSession session;
@@ -54,6 +54,7 @@ public class IndexManagerTest extends Ab
         return new ContentRepositoryImpl(mk, null, (ValidatorProvider) null);
     }
 
+    @Override
     @Before
     public void before() throws Exception {
         super.before();
@@ -198,7 +199,7 @@ public class IndexManagerTest extends Ab
         }
 
         @Override
-        public NodeState editCommit(NodeStore store, NodeState before,
+        public NodeState processCommit(NodeStore store, NodeState before,
                 NodeState after) throws CommitFailedException {
             return null;
         }

Modified: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/AbstractRepositoryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/AbstractRepositoryTest.java?rev=1378491&r1=1378490&r2=1378491&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/AbstractRepositoryTest.java (original)
+++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/AbstractRepositoryTest.java Wed Aug 29 09:59:23 2012
@@ -18,9 +18,8 @@ package org.apache.jackrabbit.oak.jcr;
 
 import java.util.concurrent.Executors;
 import java.util.concurrent.ScheduledExecutorService;
+
 import javax.jcr.GuestCredentials;
-import javax.jcr.Node;
-import javax.jcr.Property;
 import javax.jcr.Repository;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
@@ -30,7 +29,7 @@ import org.apache.jackrabbit.mk.core.Mic
 import org.apache.jackrabbit.oak.core.ContentRepositoryImpl;
 import org.junit.After;
 
-import static org.apache.jackrabbit.oak.jcr.RepositoryTestUtils.buildDefaultCommitEditor;
+import static org.apache.jackrabbit.oak.jcr.RepositoryTestUtils.buildDefaultCommitHook;
 
 /**
  * Abstract base class for repository tests providing methods for accessing
@@ -66,7 +65,7 @@ public abstract class AbstractRepository
         if (repository == null) {
             executor = Executors.newScheduledThreadPool(1);
             repository = new RepositoryImpl(new ContentRepositoryImpl(
-                    new MicroKernelImpl(), null, buildDefaultCommitEditor()),
+                    new MicroKernelImpl(), null, buildDefaultCommitHook()),
                     executor);
         }
         return repository;

Modified: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OakRepositoryStub.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OakRepositoryStub.java?rev=1378491&r1=1378490&r2=1378491&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OakRepositoryStub.java (original)
+++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OakRepositoryStub.java Wed Aug 29 09:59:23 2012
@@ -16,8 +16,6 @@
  */
 package org.apache.jackrabbit.oak.jcr;
 
-import static org.apache.jackrabbit.oak.jcr.RepositoryTestUtils.buildDefaultCommitEditor;
-
 import java.io.IOException;
 import java.security.Principal;
 import java.util.Properties;
@@ -37,6 +35,8 @@ import org.apache.jackrabbit.oak.core.Co
 import org.apache.jackrabbit.test.NotExecutableException;
 import org.apache.jackrabbit.test.RepositoryStub;
 
+import static org.apache.jackrabbit.oak.jcr.RepositoryTestUtils.buildDefaultCommitHook;
+
 public class OakRepositoryStub extends RepositoryStub {
 
     private final Repository repository;
@@ -52,7 +52,7 @@ public class OakRepositoryStub extends R
         super(settings);
 
         MicroKernel microkernel = new MicroKernelImpl("target/mk-tck-" + System.currentTimeMillis());
-        ContentRepository contentRepository = new ContentRepositoryImpl(microkernel, null, buildDefaultCommitEditor());
+        ContentRepository contentRepository = new ContentRepositoryImpl(microkernel, null, buildDefaultCommitHook());
         repository = new RepositoryImpl(contentRepository, Executors.newScheduledThreadPool(1));
 
         Session session = repository.login(superuser);
@@ -87,7 +87,7 @@ public class OakRepositoryStub extends R
         throw new UnsupportedRepositoryOperationException();
     }
 
-    private static Principal UNKNOWN_PRINCIPAL = new Principal() {
+    private static final Principal UNKNOWN_PRINCIPAL = new Principal() {
         @Override
         public String getName() {
             return "an_unknown_user";

Modified: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTestUtils.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTestUtils.java?rev=1378491&r1=1378490&r2=1378491&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTestUtils.java (original)
+++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTestUtils.java Wed Aug 29 09:59:23 2012
@@ -25,20 +25,23 @@ import org.apache.jackrabbit.oak.plugins
 import org.apache.jackrabbit.oak.plugins.type.DefaultTypeEditor;
 import org.apache.jackrabbit.oak.plugins.type.TypeValidatorProvider;
 import org.apache.jackrabbit.oak.plugins.value.ConflictValidatorProvider;
-import org.apache.jackrabbit.oak.spi.commit.CommitEditor;
-import org.apache.jackrabbit.oak.spi.commit.CompositeEditor;
+import org.apache.jackrabbit.oak.spi.commit.CommitHook;
+import org.apache.jackrabbit.oak.spi.commit.CompositeHook;
 import org.apache.jackrabbit.oak.spi.commit.CompositeValidatorProvider;
-import org.apache.jackrabbit.oak.spi.commit.ValidatingEditor;
+import org.apache.jackrabbit.oak.spi.commit.ValidatingHook;
 import org.apache.jackrabbit.oak.spi.commit.ValidatorProvider;
 
 public class RepositoryTestUtils {
 
-    public static CommitEditor buildDefaultCommitEditor() {
-        List<CommitEditor> editors = new ArrayList<CommitEditor>();
-        editors.add(new DefaultTypeEditor());
-        editors.add(new ValidatingEditor(createDefaultValidatorProvider()));
-        editors.add(new LuceneEditor());
-        return new CompositeEditor(editors);
+    private RepositoryTestUtils() {
+    }
+
+    public static CommitHook buildDefaultCommitHook() {
+        List<CommitHook> hooks = new ArrayList<CommitHook>();
+        hooks.add(new DefaultTypeEditor());
+        hooks.add(new ValidatingHook(createDefaultValidatorProvider()));
+        hooks.add(new LuceneEditor());
+        return new CompositeHook(hooks);
     }
 
     private static ValidatorProvider createDefaultValidatorProvider() {

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=1378491&r1=1378490&r2=1378491&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 Wed Aug 29 09:59:23 2012
@@ -36,10 +36,10 @@ import org.apache.jackrabbit.oak.plugins
 import org.apache.jackrabbit.oak.plugins.type.DefaultTypeEditor;
 import org.apache.jackrabbit.oak.plugins.type.TypeValidatorProvider;
 import org.apache.jackrabbit.oak.plugins.value.ConflictValidatorProvider;
-import org.apache.jackrabbit.oak.spi.commit.CommitEditor;
-import org.apache.jackrabbit.oak.spi.commit.CompositeEditor;
+import org.apache.jackrabbit.oak.spi.commit.CommitHook;
+import org.apache.jackrabbit.oak.spi.commit.CompositeHook;
 import org.apache.jackrabbit.oak.spi.commit.CompositeValidatorProvider;
-import org.apache.jackrabbit.oak.spi.commit.ValidatingEditor;
+import org.apache.jackrabbit.oak.spi.commit.ValidatingHook;
 import org.apache.jackrabbit.oak.spi.commit.ValidatorProvider;
 import org.apache.jackrabbit.webdav.jcr.JCRWebdavServerServlet;
 import org.apache.jackrabbit.webdav.simple.SimpleWebdavServlet;
@@ -52,6 +52,9 @@ public class Main {
     public static final int PORT = 8080;
     public static final String URI = "http://localhost:" + PORT + "/";
 
+    private Main() {
+    }
+
     public static void main(String[] args) throws Exception {
         printProductInfo();
 
@@ -101,7 +104,7 @@ public class Main {
 
         private final MicroKernel[] kernels;
 
-        public HttpServer(String uri, String args[]) {
+        public HttpServer(String uri, String[] args) {
             context = new ServletContextHandler(ServletContextHandler.SECURITY);
             context.setContextPath("/");
 
@@ -144,7 +147,7 @@ public class Main {
 
         private void addServlets(MicroKernel kernel, String path) {
             ContentRepository repository =
-                    new ContentRepositoryImpl(kernel, null, buildDefaultCommitEditor());
+                    new ContentRepositoryImpl(kernel, null, buildDefaultCommitHook());
 
             ServletHolder oak =
                     new ServletHolder(new OakServlet(repository));
@@ -184,12 +187,12 @@ public class Main {
             context.addServlet(davex, path + "/davex/*");
         }
 
-        private static CommitEditor buildDefaultCommitEditor() {
-            List<CommitEditor> editors = new ArrayList<CommitEditor>();
-            editors.add(new DefaultTypeEditor());
-            editors.add(new ValidatingEditor(createDefaultValidatorProvider()));
-            editors.add(new LuceneEditor());
-            return new CompositeEditor(editors);
+        private static CommitHook buildDefaultCommitHook() {
+            List<CommitHook> hooks = new ArrayList<CommitHook>();
+            hooks.add(new DefaultTypeEditor());
+            hooks.add(new ValidatingHook(createDefaultValidatorProvider()));
+            hooks.add(new LuceneEditor());
+            return new CompositeHook(hooks);
         }
 
         private static ValidatorProvider createDefaultValidatorProvider() {



Mime
View raw message