Add Payload.serializedSize()
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / OSGiDistributedDataStore.java
index cfcffbfd489fe0a8d91ed2b197736a2cd6e0942b..a0f6937344ed4df0efecee05ca5c9a59cb3cbcd8 100644 (file)
@@ -53,7 +53,7 @@ public final class OSGiDistributedDataStore {
         private final String serviceType;
 
         @GuardedBy("this")
-        private ComponentInstance component;
+        private ComponentInstance<OSGiDOMStore> component;
         @GuardedBy("this")
         private boolean stopped;
 
@@ -67,6 +67,7 @@ public final class OSGiDistributedDataStore {
 
         synchronized void updateProperties(final Map<String, Object> properties) {
             if (introspector.update(properties)) {
+                LOG.info("Distributed Datastore type {} updating context", datastoreType);
                 datastore.onDatastoreContextUpdated(introspector.newContextFactory());
             }
         }
@@ -121,17 +122,16 @@ public final class OSGiDistributedDataStore {
     @Reference
     ModuleShardConfigProvider configProvider = null;
     @Reference(target = "(component.factory=" + OSGiDOMStore.FACTORY_NAME + ")")
-    ComponentFactory datastoreFactory = null;
+    ComponentFactory<OSGiDOMStore> datastoreFactory = null;
 
     private DatastoreState configDatastore;
     private DatastoreState operDatastore;
 
     @Activate
     void activate(final Map<String, Object> properties) {
-        configDatastore = createDatastore(LogicalDatastoreType.CONFIGURATION, "distributed-config", null);
-        operDatastore = createDatastore(LogicalDatastoreType.OPERATIONAL, "distributed-operational",
+        configDatastore = createDatastore(LogicalDatastoreType.CONFIGURATION, "distributed-config", properties, null);
+        operDatastore = createDatastore(LogicalDatastoreType.OPERATIONAL, "distributed-operational", properties,
             new ConfigurationImpl(configProvider));
-        modified(properties);
     }
 
     @Modified
@@ -150,9 +150,9 @@ public final class OSGiDistributedDataStore {
     }
 
     private DatastoreState createDatastore(final LogicalDatastoreType datastoreType, final String serviceType,
-            final Configuration config) {
+            final Map<String, Object> properties, final Configuration config) {
         LOG.info("Distributed Datastore type {} starting", datastoreType);
-        final DatastoreContextIntrospector introspector = introspectorFactory.newInstance(datastoreType);
+        final DatastoreContextIntrospector introspector = introspectorFactory.newInstance(datastoreType, properties);
         final AbstractDataStore datastore = DistributedDataStoreFactory.createInstance(actorSystemProvider,
             introspector.getContext(), introspector, snapshotRestore, config);
         datastore.setCloseable(schemaService.registerSchemaContextListener(datastore));