BUG 4151 : Create a shared actor system
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / config / yang / config / distributed_datastore_provider / DistributedConfigDataStoreProviderModule.java
index f78b134d42a5b6cdda965bf090ea18c64bfdea69..4ad6ca7e5e69277983e37320e0a4592fda2628f0 100644 (file)
@@ -28,8 +28,12 @@ public class DistributedConfigDataStoreProviderModule extends
     }
 
     @Override
-    public java.lang.AutoCloseable createInstance() {
+    public boolean canReuseInstance(AbstractDistributedConfigDataStoreProviderModule oldModule) {
+        return true;
+    }
 
+    @Override
+    public java.lang.AutoCloseable createInstance() {
         ConfigProperties props = getConfigProperties();
         if(props == null) {
             props = new ConfigProperties();
@@ -60,10 +64,15 @@ public class DistributedConfigDataStoreProviderModule extends
                 .shardElectionTimeoutFactor(props.getShardElectionTimeoutFactor().getValue())
                 .transactionCreationInitialRateLimit(props.getTransactionCreationInitialRateLimit().getValue())
                 .shardBatchedModificationCount(props.getShardBatchedModificationCount().getValue().intValue())
+                .shardCommitQueueExpiryTimeoutInSeconds(
+                        props.getShardCommitQueueExpiryTimeoutInSeconds().getValue().intValue())
+                .transactionDebugContextEnabled(props.getTransactionDebugContextEnabled())
+                .customRaftPolicyImplementation(props.getCustomRaftPolicyImplementation())
+                .shardSnapshotChunkSize(props.getShardSnapshotChunkSize().getValue().intValue())
                 .build();
 
         return DistributedDataStoreFactory.createInstance(getConfigSchemaServiceDependency(),
-                datastoreContext, bundleContext);
+                datastoreContext, getConfigActorSystemProviderDependency().getActorSystem(), bundleContext);
     }
 
     public void setBundleContext(BundleContext bundleContext) {