- public java.lang.AutoCloseable createInstance() {
- DatastoreContext datastoreContext = newDatastoreContext(getConfigProperties());
-
- return DistributedDataStoreFactory.createInstance(getConfigSchemaServiceDependency(),
- datastoreContext, DatastoreSnapshotRestore.instance(),
- getConfigActorSystemProviderDependency(), bundleContext);
+ public AutoCloseable createInstance() {
+ // The DistributedConfigDataStore is provided via blueprint so wait for and return it here for
+ // backwards compatibility.
+ WaitingServiceTracker<DistributedDataStoreInterface> tracker = WaitingServiceTracker.create(
+ DistributedDataStoreInterface.class, bundleContext, "(type=distributed-config)");
+ DistributedDataStoreInterface delegate = tracker.waitForService(WaitingServiceTracker.FIVE_MINUTES);
+ return new ForwardingDistributedDataStore(delegate, tracker);