X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2FDistributedDataStoreFactory.java;h=f3a55c55a720fe21e8718cc4a346c13706074f49;hb=refs%2Fchanges%2F85%2F15485%2F11;hp=5d63c92e885824c701c4cd8d6f1702dbae84da5f;hpb=85a4118a6fe51d8571a1e7bb398d954e4ceddd33;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreFactory.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreFactory.java index 5d63c92e88..f3a55c55a7 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreFactory.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreFactory.java @@ -22,17 +22,22 @@ public class DistributedDataStoreFactory { private static volatile ActorSystem persistentActorSystem = null; - public static DistributedDataStore createInstance(String name, SchemaService schemaService, - DatastoreContext datastoreContext, BundleContext bundleContext) { + public static DistributedDataStore createInstance(SchemaService schemaService, + DatastoreContext datastoreContext, BundleContext bundleContext) { + + DatastoreContextIntrospector introspector = new DatastoreContextIntrospector(datastoreContext); + DatastoreContextConfigAdminOverlay overlay = new DatastoreContextConfigAdminOverlay( + introspector, bundleContext); ActorSystem actorSystem = getOrCreateInstance(bundleContext, datastoreContext.getConfigurationReader()); Configuration config = new ConfigurationImpl("module-shards.conf", "modules.conf"); - final DistributedDataStore dataStore = - new DistributedDataStore(actorSystem, name, new ClusterWrapperImpl(actorSystem), - config, datastoreContext); + final DistributedDataStore dataStore = new DistributedDataStore(actorSystem, + new ClusterWrapperImpl(actorSystem), config, introspector.getContext()); ShardStrategyFactory.setConfiguration(config); schemaService.registerSchemaContextListener(dataStore); + + dataStore.setCloseable(overlay); return dataStore; }