4 * Generated from: yang module name: opendaylight-sal-dom-broker-impl yang module local name: dom-broker-impl
5 * Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
6 * Generated at: Wed Nov 20 17:04:41 CET 2013
8 * Do not modify this file unless it is present under src/main directory
10 package org.opendaylight.controller.config.yang.md.sal.dom.impl;
12 import org.opendaylight.controller.config.yang.md.sal.dom.statistics.DomBrokerRuntimeMXBeanImpl;
13 import org.opendaylight.controller.sal.core.api.data.DataStore;
14 import org.opendaylight.controller.sal.dom.broker.BrokerConfigActivator;
15 import org.opendaylight.controller.sal.dom.broker.BrokerImpl;
16 import org.osgi.framework.BundleContext;
18 import static com.google.common.base.Preconditions.*;
23 public final class DomBrokerImplModule extends org.opendaylight.controller.config.yang.md.sal.dom.impl.AbstractDomBrokerImplModule
26 private BundleContext bundleContext;
28 public DomBrokerImplModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
29 super(identifier, dependencyResolver);
32 public DomBrokerImplModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, DomBrokerImplModule oldModule, java.lang.AutoCloseable oldInstance) {
33 super(identifier, dependencyResolver, oldModule, oldInstance);
37 public void validate(){
39 checkArgument(getDataStore() != null, "Data Store needs to be provided for DomBroker");
43 public java.lang.AutoCloseable createInstance() {
44 final BrokerImpl broker = new BrokerImpl();
45 final BrokerConfigActivator activator = new BrokerConfigActivator();
46 final DataStore store = getDataStoreDependency();
47 activator.start(broker, store, getBundleContext());
49 final DomBrokerImplRuntimeMXBean domBrokerRuntimeMXBean = new DomBrokerRuntimeMXBeanImpl(activator.getDataService());
50 getRootRuntimeBeanRegistratorWrapper().register(domBrokerRuntimeMXBean);
54 private BundleContext getBundleContext() {
55 return this.bundleContext;
58 public void setBundleContext(BundleContext bundleContext) {
59 this.bundleContext = bundleContext;