2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
\r
4 * This program and the accompanying materials are made available under the
\r
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
\r
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
\r
11 * Generated from: yang module name: opendaylight-sal-binding-broker-impl yang module local name: binding-broker-impl
\r
12 * Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
\r
13 * Generated at: Wed Nov 20 17:33:01 CET 2013
\r
15 * Do not modify this file unless it is present under src/main directory
\r
17 package org.opendaylight.controller.config.yang.md.sal.binding.impl;
\r
19 import org.opendaylight.controller.sal.binding.codegen.impl.SingletonHolder;
\r
20 import org.opendaylight.controller.sal.binding.impl.RootBindingAwareBroker;
\r
21 import org.opendaylight.controller.sal.binding.impl.RpcProviderRegistryImpl;
\r
22 import org.opendaylight.controller.sal.binding.impl.forward.DomForwardedBindingBrokerImpl;
\r
23 import org.opendaylight.controller.sal.binding.impl.forward.DomForwardingUtils;
\r
24 import org.osgi.framework.BundleContext;
\r
26 import com.google.common.util.concurrent.MoreExecutors;
\r
31 public final class BindingBrokerImplModule extends
\r
32 org.opendaylight.controller.config.yang.md.sal.binding.impl.AbstractBindingBrokerImplModule {
\r
34 private BundleContext bundleContext;
\r
36 public BindingBrokerImplModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,
\r
37 org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
\r
38 super(identifier, dependencyResolver);
\r
41 public BindingBrokerImplModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,
\r
42 org.opendaylight.controller.config.api.DependencyResolver dependencyResolver,
\r
43 BindingBrokerImplModule oldModule, java.lang.AutoCloseable oldInstance) {
\r
44 super(identifier, dependencyResolver, oldModule, oldInstance);
\r
48 public void validate() {
\r
53 public java.lang.AutoCloseable createInstance() {
\r
55 RootBindingAwareBroker broker;
\r
56 if (DomForwardingUtils.isDomForwardedBroker(getDataBrokerDependency())) {
\r
57 broker = createForwardedBroker();
\r
59 broker = createStandaloneBroker();
\r
65 private RootBindingAwareBroker createStandaloneBroker() {
\r
66 RootBindingAwareBroker broker = new RootBindingAwareBroker(getIdentifier().getInstanceName());
\r
68 broker.setDataBroker(getDataBrokerDependency());
\r
69 broker.setNotificationBroker(getNotificationServiceDependency());
\r
70 broker.setRpcBroker(new RpcProviderRegistryImpl(broker.getIdentifier()));
\r
74 private RootBindingAwareBroker createForwardedBroker() {
\r
75 DomForwardedBindingBrokerImpl broker = new DomForwardedBindingBrokerImpl(getIdentifier().getInstanceName());
\r
77 broker.setDataBroker(getDataBrokerDependency());
\r
78 broker.setNotificationBroker(getNotificationServiceDependency());
\r
79 broker.setRpcBroker(new RpcProviderRegistryImpl(broker.getIdentifier()));
\r
81 broker.getMountManager().setDataCommitExecutor(SingletonHolder.getDefaultCommitExecutor());
\r
82 broker.getMountManager().setNotificationExecutor(SingletonHolder.getDefaultNotificationExecutor());
\r
85 DomForwardingUtils.reuseForwardingFrom(broker, broker.getDataBroker());
\r
86 broker.startForwarding();
\r
90 public BundleContext getBundleContext() {
\r
91 return bundleContext;
\r
94 public void setBundleContext(BundleContext bundleContext) {
\r
95 this.bundleContext = bundleContext;
\r