Integrate MRI projects for Neon
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / resources / org / opendaylight / blueprint / clustered-datastore.xml
index 6f4301f99288153a37678c48f64c782f3b300eb8..0c3e5da9ceeb76a642d0bfcd55ba4fcf9b99831c 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
            xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0"
-           xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0">
+           xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.2.0">
 
   <cm:property-placeholder persistent-id="org.opendaylight.controller.cluster.datastore.broker" update-strategy="none">
     <cm:default-properties>
 
   <odl:static-reference id="schemaService" interface="org.opendaylight.mdsal.dom.api.DOMSchemaService" />
 
+  <reference id="classLoadingStrategy" interface="org.opendaylight.mdsal.binding.generator.api.ClassLoadingStrategy" />
+
   <!-- ActorSystemProvider -->
 
-  <bean id="bundleClassLoader" class="org.opendaylight.controller.config.yang.config.actor_system_provider.impl.factory.osgi.BundleClassLoaderFactory"
+  <bean id="bundleClassLoader" class="org.opendaylight.controller.cluster.akka.osgi.impl.BundleClassLoaderFactory"
           factory-method="createClassLoader">
     <argument ref="blueprintBundleContext" />
   </bean>
 
-  <bean id="actorSystemProps" class="org.opendaylight.controller.config.yang.config.actor_system_provider.impl.factory.osgi.QuarantinedMonitorActorPropsFactory"
+  <bean id="actorSystemProps" class="org.opendaylight.controller.cluster.akka.osgi.impl.QuarantinedMonitorActorPropsFactory"
           factory-method="createProps">
     <argument ref="blueprintBundleContext" />
   </bean>
 
   <bean id="akkaReader" class="org.opendaylight.controller.cluster.common.actor.FileAkkaConfigurationReader"/>
-  <bean id="akkaConfig" class="org.opendaylight.controller.config.yang.config.actor_system_provider.impl.factory.AkkaConfigFactory"
+  <bean id="akkaConfig" class="org.opendaylight.controller.cluster.akka.impl.AkkaConfigFactory"
           factory-method="createAkkaConfig">
     <argument ref="akkaReader" />
   </bean>
 
-  <bean id="actorSystemProvider" class="org.opendaylight.controller.config.yang.config.actor_system_provider.impl.ActorSystemProviderImpl"
+  <bean id="actorSystemProvider" class="org.opendaylight.controller.cluster.akka.impl.ActorSystemProviderImpl"
           destroy-method="close">
     <argument ref="bundleClassLoader" />
     <argument ref="actorSystemProps"/>
 
   <service ref="actorSystemProvider" interface="org.opendaylight.controller.cluster.ActorSystemProvider"/>
 
-  <!-- Distributed Config Datastore -->
+  <!-- Datastore properties -->
+  <cm:cm-properties id="datastoreProps" persistent-id="org.opendaylight.controller.cluster.datastore"/>
 
+  <!-- Distributed Config Datastore -->
   <bean id="datastoreSnapshotRestore" class="org.opendaylight.controller.cluster.datastore.DatastoreSnapshotRestore"
           factory-method="instance">
     <argument value="./clustered-datastore-restore"/>
   </bean>
 
-  <bean id="configDatastoreContext" class="org.opendaylight.controller.config.yang.config.distributed_datastore_provider.DistributedConfigDataStoreProviderModule"
-          factory-method="newDatastoreContext" />
+  <bean id="introspectorFactory" class="org.opendaylight.controller.cluster.datastore.DatastoreContextIntrospectorFactory">
+    <argument ref="schemaService"/>
+    <argument ref="classLoadingStrategy"/>
+  </bean>
+
+  <bean id="introspectorConfig" factory-ref="introspectorFactory" factory-method="newInstance">
+    <argument type="org.opendaylight.mdsal.common.api.LogicalDatastoreType" value="CONFIGURATION"/>
+  </bean>
+
+  <bean id="updaterConfig" class="org.opendaylight.controller.cluster.datastore.DatastoreContextPropertiesUpdater">
+    <cm:managed-properties persistent-id="org.opendaylight.controller.cluster.datastore" update-strategy="component-managed" update-method="update"/>
+    <argument ref="introspectorConfig"/>
+    <argument ref="datastoreProps"/>
+  </bean>
 
   <bean id="configDatastore" class="org.opendaylight.controller.cluster.datastore.DistributedDataStoreFactory"
           factory-method="createInstance" destroy-method="close">
     <argument ref="schemaService"/>
-    <argument ref="configDatastoreContext"/>
+    <argument>
+      <bean factory-ref="introspectorConfig" factory-method="getContext" />
+    </argument>
     <argument ref="datastoreSnapshotRestore"/>
     <argument ref="actorSystemProvider"/>
-    <argument ref="blueprintBundleContext"/>
+    <argument ref="introspectorConfig"/>
+    <argument ref="updaterConfig"/>
   </bean>
 
   <service ref="configDatastore" odl:type="distributed-config">
     <argument ref="fileModuleShardConfigProvider"/>
   </bean>
 
-  <bean id="operDatastoreContext" class="org.opendaylight.controller.config.yang.config.distributed_datastore_provider.DistributedOperationalDataStoreProviderModule"
-          factory-method="newDatastoreContext" />
+  <bean id="introspectorOper" factory-ref="introspectorFactory" factory-method="newInstance">
+    <argument type="org.opendaylight.mdsal.common.api.LogicalDatastoreType" value="OPERATIONAL"/>
+  </bean>
+
+  <bean id="updaterOper" class="org.opendaylight.controller.cluster.datastore.DatastoreContextPropertiesUpdater">
+    <cm:managed-properties persistent-id="org.opendaylight.controller.cluster.datastore" update-strategy="component-managed" update-method="update"/>
+    <argument ref="introspectorOper"/>
+    <argument ref="datastoreProps"/>
+  </bean>
 
   <bean id="operDatastore" class="org.opendaylight.controller.cluster.datastore.DistributedDataStoreFactory"
           factory-method="createInstance" destroy-method="close">
     <argument ref="schemaService"/>
-    <argument ref="operDatastoreContext"/>
+    <argument>
+      <bean factory-ref="introspectorOper" factory-method="getContext" />
+    </argument>
     <argument ref="datastoreSnapshotRestore"/>
     <argument ref="actorSystemProvider"/>
-    <argument ref="blueprintBundleContext"/>
+    <argument ref="introspectorOper"/>
+    <argument ref="updaterOper"/>
     <argument ref="configurationImpl" />
   </bean>
 
     <argument value="${max-data-broker-future-callback-pool-size}"/>
     <argument value="${max-data-broker-future-callback-queue-size}"/>
     <argument value="CommitFutures"/>
+    <argument>
+    <!-- We should use a more specific class -->
+      <bean factory-ref="operDatastore" factory-method="getClass"/>
+    </argument>
   </bean>
 
   <bean id="commitStatsTracker" class="org.opendaylight.yangtools.util.DurationStatisticsTracker"
     <argument ref="commitStatsTracker"/>
   </bean>
 
-  <service ref="clusteredDOMDataBroker" interface="org.opendaylight.controller.md.sal.dom.api.DOMDataBroker"
+  <service ref="clusteredDOMDataBroker" interface="org.opendaylight.mdsal.dom.api.DOMDataBroker"
+          odl:type="default"/>
+
+  <bean id="legacyDOMDataBroker" class="org.opendaylight.controller.sal.core.compat.LegacyDOMDataBrokerAdapter">
+    <argument ref="clusteredDOMDataBroker"/>
+  </bean>
+
+  <service ref="legacyDOMDataBroker" interface="org.opendaylight.controller.md.sal.dom.api.DOMDataBroker"
           odl:type="default"/>
 
   <!-- JMX beans for the data broker -->
     <argument ref="listenableFutureExecutor"/>
     <argument value="CommitFutureExecutorStats"/>
     <argument value="DOMDataBroker"/>
-    <argument><null/></argument>
   </bean>
 
   <!-- Distributed EntityOwnershipService -->
+  <cm:cm-properties id="strategiesProps" persistent-id="org.opendaylight.controller.cluster.entity.owner.selection.strategies" />
 
   <bean id="selectionStrategyConfig" class="org.opendaylight.controller.cluster.datastore.entityownership.selectionstrategy.EntityOwnerSelectionStrategyConfigReader"
           factory-method="loadStrategyWithConfig">
-    <argument ref="blueprintBundleContext"/>
+    <argument ref="strategiesProps"/>
   </bean>
 
   <bean id="distributedEntityOwnershipService" class="org.opendaylight.controller.cluster.datastore.entityownership.DistributedEntityOwnershipService"