/* * 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; import org.osgi.framework.BundleContext; /** * */ public final class BindingBrokerImplModule extends org.opendaylight.controller.config.yang.md.sal.binding.impl.AbstractBindingBrokerImplModule { private BundleContext bundleContext; public BindingBrokerImplModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) { super(identifier, dependencyResolver); } public BindingBrokerImplModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, BindingBrokerImplModule oldModule, 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.setDataBroker(getDataBrokerDependency()); broker.setNotificationBroker(getNotificationServiceDependency()); broker.setRpcBroker(new RpcProviderRegistryImpl(broker.getIdentifier())); return broker; } private RootBindingAwareBroker createForwardedBroker() { DomForwardedBindingBrokerImpl broker = new DomForwardedBindingBrokerImpl(getIdentifier().getInstanceName()); broker.setDataBroker(getDataBrokerDependency()); broker.setNotificationBroker(getNotificationServiceDependency()); broker.setRpcBroker(new RpcProviderRegistryImpl(broker.getIdentifier())); broker.getMountManager().setDataCommitExecutor(SingletonHolder.getDefaultCommitExecutor()); broker.getMountManager().setNotificationExecutor(SingletonHolder.getDefaultNotificationExecutor()); DomForwardingUtils.reuseForwardingFrom(broker, broker.getDataBroker()); broker.startForwarding(); return broker; } public BundleContext getBundleContext() { return bundleContext; } public void setBundleContext(BundleContext bundleContext) { this.bundleContext = bundleContext; } }