jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexparvule...@apache.org
Subject svn commit: r1412468 - in /jackrabbit/oak/trunk: oak-core/src/main/java/org/apache/jackrabbit/oak/ oak-core/src/main/java/org/apache/jackrabbit/oak/osgi/ oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/ oak-core/src/main/java/org/apache/...
Date Thu, 22 Nov 2012 09:22:27 GMT
Author: alexparvulescu
Date: Thu Nov 22 09:22:24 2012
New Revision: 1412468

URL: http://svn.apache.org/viewvc?rev=1412468&view=rev
Log:
OAK-410 RepositoryInitializer runs before the CommitHooks are in place

Added:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/lifecycle/OakInitializer.java
  (with props)
Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/Oak.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/osgi/OsgiRepositoryInitializer.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/IndexHookManager.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/api/UniquePropertyTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/nodetype/NodeTypeIndexTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexQueryTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserProviderTest.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/Jcr.java
    jackrabbit/oak/trunk/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexQueryTest.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=1412468&r1=1412467&r2=1412468&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 Thu Nov
22 09:22:24 2012
@@ -21,7 +21,6 @@ import javax.annotation.Nonnull;
 import javax.jcr.NoSuchWorkspaceException;
 import javax.security.auth.login.LoginException;
 
-import com.google.common.collect.Lists;
 import org.apache.jackrabbit.mk.api.MicroKernel;
 import org.apache.jackrabbit.mk.core.MicroKernelImpl;
 import org.apache.jackrabbit.oak.api.ContentRepository;
@@ -29,6 +28,9 @@ import org.apache.jackrabbit.oak.api.Con
 import org.apache.jackrabbit.oak.api.Root;
 import org.apache.jackrabbit.oak.core.ContentRepositoryImpl;
 import org.apache.jackrabbit.oak.kernel.KernelNodeStore;
+import org.apache.jackrabbit.oak.plugins.index.CompositeIndexHookProvider;
+import org.apache.jackrabbit.oak.plugins.index.IndexHookManager;
+import org.apache.jackrabbit.oak.plugins.index.IndexHookProvider;
 import org.apache.jackrabbit.oak.spi.commit.CommitHook;
 import org.apache.jackrabbit.oak.spi.commit.CompositeHook;
 import org.apache.jackrabbit.oak.spi.commit.CompositeValidatorProvider;
@@ -36,6 +38,8 @@ import org.apache.jackrabbit.oak.spi.com
 import org.apache.jackrabbit.oak.spi.commit.ValidatingHook;
 import org.apache.jackrabbit.oak.spi.commit.Validator;
 import org.apache.jackrabbit.oak.spi.commit.ValidatorProvider;
+import org.apache.jackrabbit.oak.spi.lifecycle.CompositeInitializer;
+import org.apache.jackrabbit.oak.spi.lifecycle.OakInitializer;
 import org.apache.jackrabbit.oak.spi.lifecycle.RepositoryInitializer;
 import org.apache.jackrabbit.oak.spi.query.CompositeQueryIndexProvider;
 import org.apache.jackrabbit.oak.spi.query.QueryIndexProvider;
@@ -47,6 +51,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import static com.google.common.base.Preconditions.checkNotNull;
+import static com.google.common.collect.Lists.newArrayList;
 
 /**
  * Builder class for constructing {@link ContentRepository} instances with
@@ -62,13 +67,15 @@ public class Oak {
 
     private final MicroKernel kernel;
 
-    private final List<RepositoryInitializer> initializers = Lists.newArrayList();
+    private final List<RepositoryInitializer> initializers = newArrayList();
 
-    private final List<QueryIndexProvider> queryIndexProviders = Lists.newArrayList();
+    private final List<QueryIndexProvider> queryIndexProviders = newArrayList();
 
-    private final List<CommitHook> commitHooks = Lists.newArrayList();
+    private final List<IndexHookProvider> indexHookProviders = newArrayList();
 
-    private List<ValidatorProvider> validatorProviders = Lists.newArrayList();
+    private final List<CommitHook> commitHooks = newArrayList();
+
+    private List<ValidatorProvider> validatorProviders = newArrayList();
 
     // TODO: review if we really want to have the OpenSecurityProvider as default.
     private SecurityProvider securityProvider = new OpenSecurityProvider();
@@ -103,6 +110,19 @@ public class Oak {
     }
 
     /**
+     * Associates the given index hook provider with the repository to
+     * be created.
+     *
+     * @param provider index hook provider
+     * @return this builder
+     */
+    @Nonnull
+    public Oak with(@Nonnull IndexHookProvider provider) {
+        indexHookProviders.add(provider);
+        return this;
+    }
+
+    /**
      * Associates the given commit hook with the repository to be created.
      *
      * @param hook commit hook
@@ -127,7 +147,7 @@ public class Oak {
         if (!validatorProviders.isEmpty()) {
             commitHooks.add(new ValidatingHook(
                     CompositeValidatorProvider.compose(validatorProviders)));
-            validatorProviders = Lists.newArrayList();
+            validatorProviders = newArrayList();
         }
     }
 
@@ -185,9 +205,13 @@ public class Oak {
 
     public ContentRepository createContentRepository() {
         KernelNodeStore store = new KernelNodeStore(kernel);
-        for (RepositoryInitializer initializer : initializers) {
-            initializer.initialize(store);
-        }
+
+        IndexHookProvider indexHooks = CompositeIndexHookProvider
+                .compose(indexHookProviders);
+        OakInitializer.initialize(store,
+                new CompositeInitializer(initializers), indexHooks);
+
+        commitHooks.add(IndexHookManager.of(indexHooks));
 
         withValidatorHook();
         store.setHook(CompositeHook.compose(commitHooks));

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=1412468&r1=1412467&r2=1412468&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
Thu Nov 22 09:22:24 2012
@@ -24,10 +24,10 @@ 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.kernel.KernelNodeStore;
-import org.apache.jackrabbit.oak.plugins.index.IndexHookManager;
 import org.apache.jackrabbit.oak.plugins.nodetype.DefaultTypeEditor;
 import org.apache.jackrabbit.oak.spi.commit.CompositeHook;
 import org.apache.jackrabbit.oak.spi.commit.ValidatingHook;
+import org.apache.jackrabbit.oak.spi.lifecycle.OakInitializer;
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
@@ -85,14 +85,15 @@ public class Activator implements Bundle
         Object service = context.getService(reference);
         if (service instanceof MicroKernel) {
             MicroKernel kernel = (MicroKernel) service;
-            kernelTracker.initialize(new KernelNodeStore(kernel));
+            OakInitializer.initialize(new KernelNodeStore(kernel),
+                    kernelTracker, indexHookProvider);
             Oak oak = new Oak(kernel)
                     .with(new CompositeHook(
                         // TODO: DefaultTypeEditor is JCR specific and does not belong here
                         new DefaultTypeEditor(),
-                        new ValidatingHook(validatorProvider),
-                        new IndexHookManager(indexHookProvider)))
-                    .with(indexProvider);
+                        new ValidatingHook(validatorProvider)))
+                    .with(indexProvider)
+                    .with(indexHookProvider);
             services.put(reference, context.registerService(
                     ContentRepository.class.getName(),
                     oak.createContentRepository(),

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/osgi/OsgiRepositoryInitializer.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/osgi/OsgiRepositoryInitializer.java?rev=1412468&r1=1412467&r2=1412468&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/osgi/OsgiRepositoryInitializer.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/osgi/OsgiRepositoryInitializer.java
Thu Nov 22 09:22:24 2012
@@ -56,6 +56,7 @@ public class OsgiRepositoryInitializer
                 (RepositoryInitializer) super.addingService(reference);
         NodeStore store = this.store;
         if (store != null) {
+            //TODO index added content
             mki.initialize(store);
         }
         return mki;

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/IndexHookManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/IndexHookManager.java?rev=1412468&r1=1412467&r2=1412468&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/IndexHookManager.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/IndexHookManager.java
Thu Nov 22 09:22:24 2012
@@ -41,7 +41,11 @@ public class IndexHookManager implements
 
     private final IndexHookProvider provider;
 
-    public IndexHookManager(IndexHookProvider provider) {
+    public static final IndexHookManager of(IndexHookProvider provider) {
+        return new IndexHookManager(provider);
+    }
+
+    protected IndexHookManager(IndexHookProvider provider) {
         this.provider = provider;
     }
 

Added: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/lifecycle/OakInitializer.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/lifecycle/OakInitializer.java?rev=1412468&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/lifecycle/OakInitializer.java
(added)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/lifecycle/OakInitializer.java
Thu Nov 22 09:22:24 2012
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.jackrabbit.oak.spi.lifecycle;
+
+import org.apache.jackrabbit.oak.api.CommitFailedException;
+import org.apache.jackrabbit.oak.plugins.index.IndexHookManager;
+import org.apache.jackrabbit.oak.plugins.index.IndexHookProvider;
+import org.apache.jackrabbit.oak.plugins.memory.MemoryNodeState;
+import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
+import org.apache.jackrabbit.oak.spi.state.NodeStore;
+import org.apache.jackrabbit.oak.spi.state.NodeStoreBranch;
+
+public class OakInitializer {
+
+    public static void initialize(NodeStore store,
+            RepositoryInitializer initializer, IndexHookProvider indexHook) {
+
+        // TODO refactor initializer to be able to first #branch, then
+        // #initialize, next #index and finally #merge
+        // This means that the RepositoryInitializer should receive a
+        // NodeStoreBranch as a param
+
+        initializer.initialize(store);
+
+        NodeStoreBranch branch = store.branch();
+        NodeBuilder root = branch.getRoot().builder();
+        try {
+            branch.setRoot(IndexHookManager.of(indexHook).processCommit(
+                    MemoryNodeState.EMPTY_NODE, root.getNodeState()));
+            branch.merge();
+        } catch (CommitFailedException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+}

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

Propchange: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/lifecycle/OakInitializer.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/api/UniquePropertyTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/api/UniquePropertyTest.java?rev=1412468&r1=1412467&r2=1412468&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/api/UniquePropertyTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/api/UniquePropertyTest.java
Thu Nov 22 09:22:24 2012
@@ -20,7 +20,6 @@ import java.util.UUID;
 
 import org.apache.jackrabbit.JcrConstants;
 import org.apache.jackrabbit.oak.Oak;
-import org.apache.jackrabbit.oak.plugins.index.IndexHookManager;
 import org.apache.jackrabbit.oak.plugins.index.property.PropertyIndexHookProvider;
 import org.apache.jackrabbit.oak.plugins.nodetype.InitialContent;
 import org.apache.jackrabbit.oak.util.NodeUtil;
@@ -37,7 +36,7 @@ public class UniquePropertyTest {
     public void testUniqueness() throws CommitFailedException {
 
         Root root = new Oak()
-                .with(new IndexHookManager(new PropertyIndexHookProvider()))
+                .with(new PropertyIndexHookProvider())
                 .with(new InitialContent()).createRoot();
 
         NodeUtil node = new NodeUtil(root.getTree("/"));

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/nodetype/NodeTypeIndexTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/nodetype/NodeTypeIndexTest.java?rev=1412468&r1=1412467&r2=1412468&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/nodetype/NodeTypeIndexTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/nodetype/NodeTypeIndexTest.java
Thu Nov 22 09:22:24 2012
@@ -31,7 +31,6 @@ import org.apache.jackrabbit.oak.plugins
 import org.apache.jackrabbit.oak.plugins.index.property.PropertyIndexHookProvider;
 import org.apache.jackrabbit.oak.plugins.nodetype.InitialContent;
 import org.apache.jackrabbit.oak.query.index.FilterImpl;
-import org.apache.jackrabbit.oak.spi.commit.CompositeHook;
 import org.apache.jackrabbit.oak.spi.query.Cursor;
 import org.apache.jackrabbit.oak.spi.query.Cursors;
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
@@ -55,7 +54,7 @@ public class NodeTypeIndexTest {
     public void setup() {
         MicroKernel mk = new MicroKernelImpl();
         store = new KernelNodeStore(mk);
-        store.setHook(new CompositeHook(new IndexHookManager(new PropertyIndexHookProvider())));
+        store.setHook(IndexHookManager.of(new PropertyIndexHookProvider()));
         // initialize node types & index definitions
         new InitialContent().initialize(store);
     }

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexQueryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexQueryTest.java?rev=1412468&r1=1412467&r2=1412468&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexQueryTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexQueryTest.java
Thu Nov 22 09:22:24 2012
@@ -18,7 +18,6 @@ package org.apache.jackrabbit.oak.plugin
 
 import org.apache.jackrabbit.oak.Oak;
 import org.apache.jackrabbit.oak.api.ContentRepository;
-import org.apache.jackrabbit.oak.plugins.index.IndexHookManager;
 import org.apache.jackrabbit.oak.plugins.nodetype.InitialContent;
 import org.apache.jackrabbit.oak.query.AbstractQueryTest;
 
@@ -33,7 +32,7 @@ public class PropertyIndexQueryTest exte
         return new Oak()
             .with(new InitialContent())
             .with(new PropertyIndexProvider())
-            .with(new IndexHookManager(new PropertyIndexHookProvider()))
+            .with(new PropertyIndexHookProvider())
             .createContentRepository();
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserProviderTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserProviderTest.java?rev=1412468&r1=1412467&r2=1412468&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserProviderTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserProviderTest.java
Thu Nov 22 09:22:24 2012
@@ -24,7 +24,6 @@ import org.apache.jackrabbit.oak.Oak;
 import org.apache.jackrabbit.oak.api.CommitFailedException;
 import org.apache.jackrabbit.oak.api.Root;
 import org.apache.jackrabbit.oak.api.Tree;
-import org.apache.jackrabbit.oak.plugins.index.IndexHookManager;
 import org.apache.jackrabbit.oak.plugins.index.property.PropertyIndexHookProvider;
 import org.apache.jackrabbit.oak.plugins.nodetype.InitialContent;
 import org.apache.jackrabbit.oak.spi.security.ConfigurationParameters;
@@ -58,7 +57,7 @@ public class UserProviderTest {
     public void setUp() throws Exception {
         root = new Oak()
                 .with(new InitialContent())
-                .with(new IndexHookManager(new PropertyIndexHookProvider()))
+                .with(new PropertyIndexHookProvider())
                 .createRoot();
 
         defaultConfig = new ConfigurationParameters();

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/Jcr.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/Jcr.java?rev=1412468&r1=1412467&r2=1412468&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/Jcr.java (original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/Jcr.java Thu
Nov 22 09:22:24 2012
@@ -25,8 +25,7 @@ import org.apache.jackrabbit.mk.api.Micr
 import org.apache.jackrabbit.oak.Oak;
 import org.apache.jackrabbit.oak.plugins.commit.AnnotatingConflictHandler;
 import org.apache.jackrabbit.oak.plugins.commit.ConflictValidatorProvider;
-import org.apache.jackrabbit.oak.plugins.index.CompositeIndexHookProvider;
-import org.apache.jackrabbit.oak.plugins.index.IndexHookManager;
+import org.apache.jackrabbit.oak.plugins.index.IndexHookProvider;
 import org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexHookProvider;
 import org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexProvider;
 import org.apache.jackrabbit.oak.plugins.index.nodetype.NodeTypeIndexProvider;
@@ -73,14 +72,13 @@ public class Jcr {
         with(new RegistrationValidatorProvider());
         with(new ConflictValidatorProvider());
 
-        with(new IndexHookManager(
-                new CompositeIndexHookProvider(
-                new PropertyIndexHookProvider(), 
-                new LuceneIndexHookProvider())));
+        with(new PropertyIndexHookProvider());
         with(new AnnotatingConflictHandler());
 
         with(new PropertyIndexProvider());
         with(new NodeTypeIndexProvider());
+
+        with(new LuceneIndexHookProvider());
         with(new LuceneIndexProvider());
     }
 
@@ -105,6 +103,12 @@ public class Jcr {
     }
 
     @Nonnull
+    public Jcr with(@Nonnull IndexHookProvider indexHookProvider) {
+        oak.with(checkNotNull(indexHookProvider));
+        return this;
+    }
+
+    @Nonnull
     public Jcr with(@Nonnull CommitHook hook) {
         oak.with(checkNotNull(hook));
         return this;

Modified: jackrabbit/oak/trunk/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexQueryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexQueryTest.java?rev=1412468&r1=1412467&r2=1412468&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexQueryTest.java
(original)
+++ jackrabbit/oak/trunk/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexQueryTest.java
Thu Nov 22 09:22:24 2012
@@ -25,7 +25,6 @@ import java.util.Iterator;
 import org.apache.jackrabbit.oak.Oak;
 import org.apache.jackrabbit.oak.api.ContentRepository;
 import org.apache.jackrabbit.oak.api.Tree;
-import org.apache.jackrabbit.oak.plugins.index.IndexHookManager;
 import org.apache.jackrabbit.oak.plugins.nodetype.InitialContent;
 import org.apache.jackrabbit.oak.query.AbstractQueryTest;
 import org.apache.jackrabbit.oak.query.JsopUtil;
@@ -50,7 +49,7 @@ public class LuceneIndexQueryTest extend
         return new Oak()
             .with(new InitialContent())
             .with(new LuceneIndexProvider())
-            .with(new IndexHookManager(new LuceneIndexHookProvider()))
+            .with(new LuceneIndexHookProvider())
             .createContentRepository();
     }
 

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=1412468&r1=1412467&r2=1412468&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 Thu
Nov 22 09:22:24 2012
@@ -205,7 +205,7 @@ public class Main {
             return new CompositeHook(
                     new DefaultTypeEditor(),
                     new ValidatingHook(createDefaultValidatorProvider()),
-                    new IndexHookManager(
+                    IndexHookManager.of(
                             new CompositeIndexHookProvider(
                             new PropertyIndexHookProvider(), 
                             new LuceneIndexHookProvider())));



Mime
View raw message