You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by to...@apache.org on 2017/03/23 08:05:53 UTC
svn commit: r1788187 -
/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java
Author: tomekr
Date: Thu Mar 23 08:05:53 2017
New Revision: 1788187
URL: http://svn.apache.org/viewvc?rev=1788187&view=rev
Log:
OAK-4839: Allow to register DocumentNodeStore as a NodeStoreProvider
Register the DocumentNodeStore and Clusterable services, so the
discovery-lite can use the DocumentNodeStore even if the latter is
exposed as NodeStoreProvider.
Modified:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java
Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java?rev=1788187&r1=1788186&r2=1788187&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java Thu Mar 23 08:05:53 2017
@@ -612,9 +612,19 @@ public class DocumentNodeStoreService {
log.warn("registerNodeStore: got RuntimeException while trying to determine time difference to server: " + e, e);
}
+ String[] serviceClasses;
if (isNodeStoreProvider()) {
registerNodeStoreProvider(nodeStore);
- return;
+ serviceClasses = new String[]{
+ DocumentNodeStore.class.getName(),
+ Clusterable.class.getName()
+ };
+ } else {
+ serviceClasses = new String[]{
+ NodeStore.class.getName(),
+ DocumentNodeStore.class.getName(),
+ Clusterable.class.getName()
+ };
}
Dictionary<String, Object> props = new Hashtable<String, Object>();
@@ -624,11 +634,7 @@ public class DocumentNodeStoreService {
// require a service DocumentNodeStore (instead of having to do an 'instanceof')
// the registration is now done for both NodeStore and DocumentNodeStore here.
nodeStoreReg = context.getBundleContext().registerService(
- new String[]{
- NodeStore.class.getName(),
- DocumentNodeStore.class.getName(),
- Clusterable.class.getName()
- },
+ serviceClasses,
nodeStore, props);
}