- //Initializing Operational DOM DataStore defaulting to InMemoryDOMDataStore if one is not configured
- DOMStore operStore = getOperationalDataStoreDependency();
- if(operStore == null){
- //we will default to InMemoryDOMDataStore creation
- operStore = InMemoryDOMDataStoreFactory.create("DOM-OPER", getSchemaServiceDependency());
- }
-
- DOMStore configStore = getConfigDataStoreDependency();
- if(configStore == null){
- //we will default to InMemoryDOMDataStore creation
- configStore = InMemoryDOMDataStoreFactory.create("DOM-CFG", getSchemaServiceDependency());
- }
-
- final Map<LogicalDatastoreType, DOMStore> datastores = new EnumMap<>(LogicalDatastoreType.class);
- datastores.put(LogicalDatastoreType.OPERATIONAL, operStore);
- datastores.put(LogicalDatastoreType.CONFIGURATION, configStore);
-
- /*
- * We use an executor for commit ListenableFuture callbacks that favors reusing available
- * threads over creating new threads at the expense of execution time. The assumption is
- * that most ListenableFuture callbacks won't execute a lot of business logic where we want
- * it to run quicker - many callbacks will likely just handle error conditions and do
- * nothing on success. The executor queue capacity is bounded and, if the capacity is
- * reached, subsequent submitted tasks will block the caller.
- */
- ExecutorService listenableFutureExecutor = SpecialExecutors.newBlockingBoundedCachedThreadPool(
- getMaxDataBrokerFutureCallbackPoolSize(), getMaxDataBrokerFutureCallbackQueueSize(),
- "CommitFutures");
+ // The ConcurrentDOMDataBroker is provided via blueprint so wait for and return it here for
+ // backwards compatibility.
+ WaitingServiceTracker<DOMDataBroker> tracker = WaitingServiceTracker.create(
+ DOMDataBroker.class, bundleContext, "(type=default)");
+ DOMDataBroker delegate = tracker.waitForService(WaitingServiceTracker.FIVE_MINUTES);
+ return new ForwardingConcurrentDOMBroker(delegate, tracker);
+ }