A bunch of miscellaneous services to get Distributed Data Store ready for deployment
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / config / yang / config / distributed_datastore_provider / DistributedConfigDataStoreProviderModule.java
index 665cb2d..039446b 100644 (file)
@@ -1,15 +1,20 @@
 package org.opendaylight.controller.config.yang.config.distributed_datastore_provider;
 
-import akka.actor.ActorSystem;
-import com.typesafe.config.ConfigFactory;
-import org.opendaylight.controller.cluster.datastore.DistributedDataStore;
+import org.opendaylight.controller.cluster.datastore.DistributedDataStoreFactory;
 
-public class DistributedConfigDataStoreProviderModule extends org.opendaylight.controller.config.yang.config.distributed_datastore_provider.AbstractDistributedConfigDataStoreProviderModule {
-    public DistributedConfigDataStoreProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
+public class DistributedConfigDataStoreProviderModule extends
+    org.opendaylight.controller.config.yang.config.distributed_datastore_provider.AbstractDistributedConfigDataStoreProviderModule {
+    public DistributedConfigDataStoreProviderModule(
+        org.opendaylight.controller.config.api.ModuleIdentifier identifier,
+        org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
         super(identifier, dependencyResolver);
     }
 
-    public DistributedConfigDataStoreProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.controller.config.yang.config.distributed_datastore_provider.DistributedConfigDataStoreProviderModule oldModule, java.lang.AutoCloseable oldInstance) {
+    public DistributedConfigDataStoreProviderModule(
+        org.opendaylight.controller.config.api.ModuleIdentifier identifier,
+        org.opendaylight.controller.config.api.DependencyResolver dependencyResolver,
+        org.opendaylight.controller.config.yang.config.distributed_datastore_provider.DistributedConfigDataStoreProviderModule oldModule,
+        java.lang.AutoCloseable oldInstance) {
         super(identifier, dependencyResolver, oldModule, oldInstance);
     }
 
@@ -20,22 +25,8 @@ public class DistributedConfigDataStoreProviderModule extends org.opendaylight.c
 
     @Override
     public java.lang.AutoCloseable createInstance() {
-     final ActorSystem actorSystem = ActorSystem.create("opendaylight-cluster-system", ConfigFactory
-          .load().getConfig("ODLCluster"));
-
-
-      final DistributedDataStore configDatastore = new DistributedDataStore(actorSystem, "config");
-      getSchemaServiceDependency().registerSchemaServiceListener(configDatastore);
-
-      final class AutoCloseableDistributedDataStore implements AutoCloseable {
-
-        @Override
-        public void close() throws Exception {
-          actorSystem.shutdown();
-        }
-      }
-
-      return new AutoCloseableDistributedDataStore();
+        return DistributedDataStoreFactory
+            .createInstance("config", getSchemaServiceDependency());
     }
 
 }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.