import org.opendaylight.controller.sal.core.api.Provider;
import org.opendaylight.controller.sal.core.api.model.SchemaService;
import org.opendaylight.yangtools.yang.data.impl.codec.BindingIndependentMappingService;
-import org.osgi.framework.BundleContext;
public class BindingAsyncDataBrokerImplModule extends
org.opendaylight.controller.config.yang.md.sal.binding.impl.AbstractBindingAsyncDataBrokerImplModule implements
Provider {
- private BundleContext bundleContext;
public BindingAsyncDataBrokerImplModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier,
final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
// FIXME: Switch this to DOM Broker registration which would not require
// BundleContext when API are updated.
- ProviderSession session = domBroker.registerProvider(this, getBundleContext());
+ ProviderSession session = domBroker.registerProvider(this, null);
DOMDataBroker domDataBroker = session.getService(DOMDataBroker.class);
SchemaService schemaService = session.getService(SchemaService.class);
return new ForwardedBindingDataBroker(domDataBroker, mappingService, schemaService);
}
- // FIXME: Remove this when DOM Broker registration would not require
- // BundleContext
- @Deprecated
- private BundleContext getBundleContext() {
- return bundleContext;
- }
- // FIXME: Remove this when DOM Broker registration would not require
- // BundleContext
- @Deprecated
- void setBundleContext(final BundleContext bundleContext) {
- this.bundleContext = bundleContext;
- }
+
+
@Override
public Collection<ProviderFunctionality> getProviderFunctionality() {
*/
package org.opendaylight.controller.config.yang.md.sal.binding.impl;
-import org.opendaylight.controller.config.api.DependencyResolver;
-import org.osgi.framework.BundleContext;
public class BindingAsyncDataBrokerImplModuleFactory extends org.opendaylight.controller.config.yang.md.sal.binding.impl.AbstractBindingAsyncDataBrokerImplModuleFactory {
-
-
-
- @Override
- public BindingAsyncDataBrokerImplModule instantiateModule(final String instanceName,
- final DependencyResolver dependencyResolver, final BindingAsyncDataBrokerImplModule oldModule,
- final AutoCloseable oldInstance, final BundleContext bundleContext) {
- BindingAsyncDataBrokerImplModule module = super.instantiateModule(instanceName, dependencyResolver, oldModule, oldInstance, bundleContext);
- module.setBundleContext(bundleContext);
- return module;
- }
-
- @Override
- public BindingAsyncDataBrokerImplModule instantiateModule(final String instanceName,
- final DependencyResolver dependencyResolver, final BundleContext bundleContext) {
- // TODO Auto-generated method stub
- BindingAsyncDataBrokerImplModule module = super.instantiateModule(instanceName, dependencyResolver, bundleContext);
- module.setBundleContext(bundleContext);
- return module;
- }
}
-/*\r
- * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-/**\r
- * Generated file\r
-\r
- * Generated from: yang module name: opendaylight-sal-binding-broker-impl yang module local name: binding-broker-impl\r
- * Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator\r
- * Generated at: Wed Nov 20 17:33:01 CET 2013\r
- *\r
- * Do not modify this file unless it is present under src/main directory\r
- */\r
-package org.opendaylight.controller.config.yang.md.sal.binding.impl;\r
-\r
-import org.opendaylight.controller.sal.binding.codegen.impl.SingletonHolder;\r
-import org.opendaylight.controller.sal.binding.impl.RootBindingAwareBroker;\r
-import org.opendaylight.controller.sal.binding.impl.RpcProviderRegistryImpl;\r
-import org.opendaylight.controller.sal.binding.impl.forward.DomForwardedBindingBrokerImpl;\r
-import org.opendaylight.controller.sal.binding.impl.forward.DomForwardingUtils;\r
-import org.osgi.framework.BundleContext;\r
-\r
-/**\r
-*\r
-*/\r
-public final class BindingBrokerImplModule extends\r
- org.opendaylight.controller.config.yang.md.sal.binding.impl.AbstractBindingBrokerImplModule {\r
-\r
- private BundleContext bundleContext;\r
-\r
- public BindingBrokerImplModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier,\r
- final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {\r
- super(identifier, dependencyResolver);\r
- }\r
-\r
- public BindingBrokerImplModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier,\r
- final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver,\r
- final BindingBrokerImplModule oldModule, final java.lang.AutoCloseable oldInstance) {\r
- super(identifier, dependencyResolver, oldModule, oldInstance);\r
- }\r
-\r
- @Override\r
- public void validate() {\r
- super.validate();\r
- }\r
-\r
- @Override\r
- public java.lang.AutoCloseable createInstance() {\r
-\r
- RootBindingAwareBroker broker;\r
- if (DomForwardingUtils.isDomForwardedBroker(getDataBrokerDependency())) {\r
- broker = createForwardedBroker();\r
- } else {\r
- broker = createStandaloneBroker();\r
- }\r
- broker.start();\r
- return broker;\r
- }\r
-\r
- private RootBindingAwareBroker createStandaloneBroker() {\r
- RootBindingAwareBroker broker = new RootBindingAwareBroker(getIdentifier().getInstanceName());\r
-\r
- broker.setLegacyDataBroker(getDataBrokerDependency());\r
- broker.setNotificationBroker(getNotificationServiceDependency());\r
- broker.setRpcBroker(new RpcProviderRegistryImpl(broker.getIdentifier()));\r
- // FIXME: Also set Async Data Broker\r
- return broker;\r
- }\r
-\r
- private RootBindingAwareBroker createForwardedBroker() {\r
- DomForwardedBindingBrokerImpl broker = new DomForwardedBindingBrokerImpl(getIdentifier().getInstanceName());\r
-\r
- broker.setLegacyDataBroker(getDataBrokerDependency());\r
- broker.setNotificationBroker(getNotificationServiceDependency());\r
- broker.setRpcBroker(new RpcProviderRegistryImpl(broker.getIdentifier()));\r
-\r
- broker.getMountManager().setDataCommitExecutor(SingletonHolder.getDefaultCommitExecutor());\r
- broker.getMountManager().setNotificationExecutor(SingletonHolder.getDefaultNotificationExecutor());\r
-\r
- // FIXME: Also set Async Data Broker\r
- DomForwardingUtils.reuseForwardingFrom(broker, broker.getDataBroker());\r
- broker.startForwarding();\r
- return broker;\r
- }\r
-\r
- public BundleContext getBundleContext() {\r
- return bundleContext;\r
- }\r
-\r
- public void setBundleContext(final BundleContext bundleContext) {\r
- this.bundleContext = bundleContext;\r
- }\r
-}\r
+/*
+ * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+/**
+ * Generated file
+
+ * Generated from: yang module name: opendaylight-sal-binding-broker-impl yang module local name: binding-broker-impl
+ * Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
+ * Generated at: Wed Nov 20 17:33:01 CET 2013
+ *
+ * Do not modify this file unless it is present under src/main directory
+ */
+package org.opendaylight.controller.config.yang.md.sal.binding.impl;
+
+import org.opendaylight.controller.sal.binding.codegen.impl.SingletonHolder;
+import org.opendaylight.controller.sal.binding.impl.RootBindingAwareBroker;
+import org.opendaylight.controller.sal.binding.impl.RpcProviderRegistryImpl;
+import org.opendaylight.controller.sal.binding.impl.forward.DomForwardedBindingBrokerImpl;
+import org.opendaylight.controller.sal.binding.impl.forward.DomForwardingUtils;
+
+/**
+*
+*/
+public final class BindingBrokerImplModule extends
+ org.opendaylight.controller.config.yang.md.sal.binding.impl.AbstractBindingBrokerImplModule {
+
+ public BindingBrokerImplModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier,
+ final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
+ super(identifier, dependencyResolver);
+ }
+
+ public BindingBrokerImplModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier,
+ final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver,
+ final BindingBrokerImplModule oldModule, final java.lang.AutoCloseable oldInstance) {
+ super(identifier, dependencyResolver, oldModule, oldInstance);
+ }
+
+ @Override
+ public void validate() {
+ super.validate();
+ }
+
+ @Override
+ public java.lang.AutoCloseable createInstance() {
+
+ RootBindingAwareBroker broker;
+ if (DomForwardingUtils.isDomForwardedBroker(getDataBrokerDependency())) {
+ broker = createForwardedBroker();
+ } else {
+ broker = createStandaloneBroker();
+ }
+ broker.start();
+ return broker;
+ }
+
+ private RootBindingAwareBroker createStandaloneBroker() {
+ RootBindingAwareBroker broker = new RootBindingAwareBroker(getIdentifier().getInstanceName());
+
+ broker.setLegacyDataBroker(getDataBrokerDependency());
+ broker.setNotificationBroker(getNotificationServiceDependency());
+ broker.setRpcBroker(new RpcProviderRegistryImpl(broker.getIdentifier()));
+ broker.setDataBroker(getRootDataBrokerDependency());
+ return broker;
+ }
+
+ private RootBindingAwareBroker createForwardedBroker() {
+ DomForwardedBindingBrokerImpl broker = new DomForwardedBindingBrokerImpl(getIdentifier().getInstanceName());
+
+ broker.setLegacyDataBroker(getDataBrokerDependency());
+ broker.setNotificationBroker(getNotificationServiceDependency());
+ broker.setRpcBroker(new RpcProviderRegistryImpl(broker.getIdentifier()));
+
+ broker.getMountManager().setDataCommitExecutor(SingletonHolder.getDefaultCommitExecutor());
+ broker.getMountManager().setNotificationExecutor(SingletonHolder.getDefaultNotificationExecutor());
+
+ broker.setDataBroker(getRootDataBrokerDependency());
+ DomForwardingUtils.reuseForwardingFrom(broker, broker.getDataBroker());
+ broker.startForwarding();
+ return broker;
+ }
+}
*/
package org.opendaylight.controller.config.yang.md.sal.binding.impl;
-import org.opendaylight.controller.config.api.DependencyResolver;
-import org.opendaylight.controller.config.api.DynamicMBeanWithInstance;
-import org.opendaylight.controller.config.spi.Module;
-import org.osgi.framework.BundleContext;
/**
*
*/
public class BindingBrokerImplModuleFactory extends org.opendaylight.controller.config.yang.md.sal.binding.impl.AbstractBindingBrokerImplModuleFactory {
-
- @Override
- public Module createModule(String instanceName, DependencyResolver dependencyResolver, BundleContext bundleContext) {
- BindingBrokerImplModule module = (BindingBrokerImplModule) super.createModule(instanceName, dependencyResolver, bundleContext);
- module.setBundleContext(bundleContext);
- return module;
- }
-
- @Override
- public Module createModule(String instanceName, DependencyResolver dependencyResolver,
- DynamicMBeanWithInstance old, BundleContext bundleContext) throws Exception {
- BindingBrokerImplModule module = (BindingBrokerImplModule) super.createModule(instanceName, dependencyResolver, old, bundleContext);
- module.setBundleContext(bundleContext);
- return module;
- }
-
}
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.controller.config.yang.md.sal.binding.impl;\r
-\r
+package org.opendaylight.controller.config.yang.md.sal.binding.impl;
+
import java.util.concurrent.ExecutorService;
import org.opendaylight.controller.sal.binding.codegen.impl.SingletonHolder;
import org.opendaylight.controller.sal.binding.impl.forward.DomForwardedDataBrokerImpl;
import org.opendaylight.controller.sal.core.api.Broker.ProviderSession;
import org.opendaylight.yangtools.yang.data.impl.codec.BindingIndependentMappingService;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-\r
-/**\r
-*\r
-*/\r
-public final class DataBrokerImplModule extends\r
- org.opendaylight.controller.config.yang.md.sal.binding.impl.AbstractDataBrokerImplModule {\r
-\r
- private BundleContext bundleContext;\r
-\r
- public DataBrokerImplModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,\r
- org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {\r
- super(identifier, dependencyResolver);\r
- }\r
-\r
- public DataBrokerImplModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,\r
- org.opendaylight.controller.config.api.DependencyResolver dependencyResolver,\r
- DataBrokerImplModule oldModule, java.lang.AutoCloseable oldInstance) {\r
- super(identifier, dependencyResolver, oldModule, oldInstance);\r
- }\r
-\r
- @Override\r
- public void validate() {\r
- super.validate();\r
- }\r
-\r
- @Override\r
- public java.lang.AutoCloseable createInstance() {\r
- RootDataBrokerImpl dataBindingBroker;\r
-\r
-\r
- ExecutorService listeningExecutor = SingletonHolder.getDefaultCommitExecutor();\r
- BindingIndependentMappingService potentialMapping = resolveMappingServiceDependency();\r
- if (getDomBrokerDependency() != null && potentialMapping != null) {\r
-\r
- dataBindingBroker = createDomConnectedBroker(listeningExecutor,potentialMapping);\r
- } else {\r
- dataBindingBroker = createStandAloneBroker(listeningExecutor);\r
- }\r
- dataBindingBroker.registerRuntimeBean(getRootRuntimeBeanRegistratorWrapper());\r
- dataBindingBroker.setNotificationExecutor(SingletonHolder.getDefaultChangeEventExecutor());\r
- return dataBindingBroker;\r
- }\r
- private BindingIndependentMappingService resolveMappingServiceDependency() {\r
- if(getMappingService() != null) {\r
- return getMappingServiceDependency();\r
- }\r
-\r
- ServiceReference<BindingIndependentMappingService> potentialMappingService = bundleContext.getServiceReference(BindingIndependentMappingService.class);\r
- if(potentialMappingService != null) {\r
- return bundleContext.getService(potentialMappingService);\r
- }\r
- return null;\r
- }\r
-\r
- private RootDataBrokerImpl createStandAloneBroker(ExecutorService listeningExecutor) {\r
- RootDataBrokerImpl broker = new RootDataBrokerImpl();\r
- broker.setExecutor(listeningExecutor);\r
- return broker;\r
- }\r
-\r
- private RootDataBrokerImpl createDomConnectedBroker(ExecutorService listeningExecutor, BindingIndependentMappingService mappingService) {\r
- DomForwardedDataBrokerImpl forwardedBroker = new DomForwardedDataBrokerImpl();\r
- forwardedBroker.setExecutor(listeningExecutor);\r
- BindingIndependentConnector connector = BindingDomConnectorDeployer.createConnector(mappingService);\r
- getDomBrokerDependency().registerProvider(forwardedBroker, getBundleContext());\r
- ProviderSession domContext = forwardedBroker.getDomProviderContext();\r
- forwardedBroker.setConnector(connector);\r
- forwardedBroker.setDomProviderContext(domContext);\r
- forwardedBroker.startForwarding();\r
- return forwardedBroker;\r
- }\r
-\r
- public BundleContext getBundleContext() {\r
- return bundleContext;\r
- }\r
-\r
- public void setBundleContext(BundleContext bundleContext2) {\r
- this.bundleContext = bundleContext2;\r
- }\r
-}\r
+
+/**
+*
+*/
+public final class DataBrokerImplModule extends
+ org.opendaylight.controller.config.yang.md.sal.binding.impl.AbstractDataBrokerImplModule {
+
+ public DataBrokerImplModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier,
+ final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
+ super(identifier, dependencyResolver);
+ }
+
+ public DataBrokerImplModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier,
+ final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver,
+ final DataBrokerImplModule oldModule, final java.lang.AutoCloseable oldInstance) {
+ super(identifier, dependencyResolver, oldModule, oldInstance);
+ }
+
+ @Override
+ public void validate() {
+ super.validate();
+ }
+
+ @Override
+ public java.lang.AutoCloseable createInstance() {
+ RootDataBrokerImpl dataBindingBroker;
+
+
+ ExecutorService listeningExecutor = SingletonHolder.getDefaultCommitExecutor();
+ BindingIndependentMappingService potentialMapping = getMappingServiceDependency();
+ if (getDomBrokerDependency() != null && potentialMapping != null) {
+
+ dataBindingBroker = createDomConnectedBroker(listeningExecutor,potentialMapping);
+ } else {
+ dataBindingBroker = createStandAloneBroker(listeningExecutor);
+ }
+ dataBindingBroker.registerRuntimeBean(getRootRuntimeBeanRegistratorWrapper());
+ dataBindingBroker.setNotificationExecutor(SingletonHolder.getDefaultChangeEventExecutor());
+ return dataBindingBroker;
+ }
+
+
+ private RootDataBrokerImpl createStandAloneBroker(final ExecutorService listeningExecutor) {
+ RootDataBrokerImpl broker = new RootDataBrokerImpl();
+ broker.setExecutor(listeningExecutor);
+ return broker;
+ }
+
+ private RootDataBrokerImpl createDomConnectedBroker(final ExecutorService listeningExecutor, final BindingIndependentMappingService mappingService) {
+ DomForwardedDataBrokerImpl forwardedBroker = new DomForwardedDataBrokerImpl();
+ forwardedBroker.setExecutor(listeningExecutor);
+ BindingIndependentConnector connector = BindingDomConnectorDeployer.createConnector(mappingService);
+ getDomBrokerDependency().registerProvider(forwardedBroker, null);
+ ProviderSession domContext = forwardedBroker.getDomProviderContext();
+ forwardedBroker.setConnector(connector);
+ forwardedBroker.setDomProviderContext(domContext);
+ forwardedBroker.startForwarding();
+ return forwardedBroker;
+ }
+
+}
*/
package org.opendaylight.controller.config.yang.md.sal.binding.impl;
-import org.opendaylight.controller.config.api.DependencyResolver;
-import org.opendaylight.controller.config.api.DynamicMBeanWithInstance;
-import org.opendaylight.controller.config.spi.Module;
-import org.osgi.framework.BundleContext;
/**
*
public class DataBrokerImplModuleFactory extends
org.opendaylight.controller.config.yang.md.sal.binding.impl.AbstractDataBrokerImplModuleFactory {
- @Override
- public Module createModule(String instanceName, DependencyResolver dependencyResolver, BundleContext bundleContext) {
- DataBrokerImplModule module = (DataBrokerImplModule) super.createModule(instanceName, dependencyResolver,
- bundleContext);
- module.setBundleContext(bundleContext);
- return module;
- }
-
- @Override
- public Module createModule(String instanceName, DependencyResolver dependencyResolver,
- DynamicMBeanWithInstance old, BundleContext bundleContext) throws Exception {
- DataBrokerImplModule module = (DataBrokerImplModule) super.createModule(instanceName, dependencyResolver, old,
- bundleContext);
- module.setBundleContext(bundleContext);
- return module;
- }
-
}
import org.opendaylight.controller.sal.core.api.Provider;
import org.opendaylight.controller.sal.core.api.model.SchemaService;
import org.opendaylight.yangtools.yang.data.impl.codec.BindingIndependentMappingService;
-import org.osgi.framework.BundleContext;
import com.google.common.util.concurrent.ListeningExecutorService;
org.opendaylight.controller.config.yang.md.sal.binding.impl.AbstractForwardedCompatibleDataBrokerImplModule
implements Provider {
- private BundleContext bundleContext;
-
public ForwardedCompatibleDataBrokerImplModule(
final org.opendaylight.controller.config.api.ModuleIdentifier identifier,
final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
BindingIndependentMappingService mappingService = getBindingMappingServiceDependency();
Broker domBroker = getDomAsyncBrokerDependency();
- ProviderSession session = domBroker.registerProvider(this, getBundleContext());
+ ProviderSession session = domBroker.registerProvider(this, null);
DOMDataBroker domDataBroker = session.getService(DOMDataBroker.class);
SchemaService schemaService = session.getService(SchemaService.class);
ForwardedBackwardsCompatibleDataBroker dataBroker = new ForwardedBackwardsCompatibleDataBroker(domDataBroker,
return dataBroker;
}
- public BundleContext getBundleContext() {
- return bundleContext;
- }
-
- public void setBundleContext(final BundleContext bundleContext2) {
- this.bundleContext = bundleContext2;
- }
-
@Override
public void onSessionInitiated(final ProviderSession session) {
*/
package org.opendaylight.controller.config.yang.md.sal.binding.impl;
-import org.opendaylight.controller.config.api.DependencyResolver;
-import org.opendaylight.controller.config.api.DynamicMBeanWithInstance;
-import org.opendaylight.controller.config.spi.Module;
-import org.osgi.framework.BundleContext;
/**
public class ForwardedCompatibleDataBrokerImplModuleFactory extends org.opendaylight.controller.config.yang.md.sal.binding.impl.AbstractForwardedCompatibleDataBrokerImplModuleFactory
{
-
- @Override
- public Module createModule(final String instanceName, final DependencyResolver dependencyResolver, final BundleContext bundleContext) {
- ForwardedCompatibleDataBrokerImplModule module = (ForwardedCompatibleDataBrokerImplModule) super.createModule(instanceName, dependencyResolver, bundleContext);
- module.setBundleContext(bundleContext);
- return module;
- }
-
- @Override
- public Module createModule(final String instanceName, final DependencyResolver dependencyResolver,
- final DynamicMBeanWithInstance old, final BundleContext bundleContext) throws Exception {
- ForwardedCompatibleDataBrokerImplModule module = (ForwardedCompatibleDataBrokerImplModule) super.createModule(instanceName, dependencyResolver, old, bundleContext);
- module.setBundleContext(bundleContext);
- return module;
- }
-
}
container data-broker {
uses config:service-ref {
refine type {
- mandatory true;
+ mandatory false;
config:required-identity sal:binding-data-broker;
}
}
}
}
}
+
+ container root-data-broker {
+ uses config:service-ref {
+ refine type {
+ mandatory false;
+ config:required-identity sal:binding-async-data-broker;
+ }
+ }
+ }
}
}
*/
package org.opendaylight.controller.config.yang.md.sal.dom.impl;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.util.concurrent.ListeningExecutorService;
-import com.google.common.util.concurrent.MoreExecutors;
+import java.util.concurrent.Executors;
+
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
import org.opendaylight.controller.md.sal.dom.broker.impl.DOMDataBrokerImpl;
import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore;
import org.opendaylight.controller.sal.core.spi.data.DOMStore;
-import org.osgi.framework.BundleContext;
-import java.util.Hashtable;
-import java.util.concurrent.Executors;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.util.concurrent.ListeningExecutorService;
+import com.google.common.util.concurrent.MoreExecutors;
/**
*
public final class DomInmemoryDataBrokerModule extends
org.opendaylight.controller.config.yang.md.sal.dom.impl.AbstractDomInmemoryDataBrokerModule {
- private BundleContext bundleContext;
-
public DomInmemoryDataBrokerModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier,
final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
super(identifier, dependencyResolver);
DOMDataBrokerImpl newDataBroker = new DOMDataBrokerImpl(datastores, MoreExecutors.listeningDecorator(Executors.newSingleThreadExecutor()));
- getBundleContext().registerService(DOMDataBroker.class, newDataBroker, new Hashtable<String, String>());
-
-
return newDataBroker;
}
-
- private BundleContext getBundleContext() {
- return bundleContext;
- }
-
- void setBundleContext(final BundleContext ctx) {
- bundleContext = ctx;
- }
}
*/
package org.opendaylight.controller.config.yang.md.sal.dom.impl;
-import org.opendaylight.controller.config.api.DependencyResolver;
-import org.opendaylight.controller.config.api.DynamicMBeanWithInstance;
-import org.opendaylight.controller.config.spi.Module;
-import org.osgi.framework.BundleContext;
/**
*
{
-
- @Override
- public Module createModule(final String instanceName, final DependencyResolver dependencyResolver, final BundleContext bundleContext) {
- DomInmemoryDataBrokerModule module = (DomInmemoryDataBrokerModule) super.createModule(instanceName, dependencyResolver, bundleContext);
- module.setBundleContext(bundleContext);
- return module;
- }
-
- @Override
- public Module createModule(final String instanceName, final DependencyResolver dependencyResolver,
- final DynamicMBeanWithInstance old, final BundleContext bundleContext) throws Exception {
- DomInmemoryDataBrokerModule module = (DomInmemoryDataBrokerModule) super.createModule(instanceName, dependencyResolver, old, bundleContext);
- module.setBundleContext(bundleContext);
- return module;
- }
}