2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
11 * Generated from: yang module name: opendaylight-sal-binding-broker-impl yang module local name: binding-broker-impl
12 * Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
13 * Generated at: Wed Nov 20 17:33:01 CET 2013
15 * Do not modify this file unless it is present under src/main directory
17 package org.opendaylight.controller.config.yang.md.sal.binding.impl;
19 import org.opendaylight.controller.md.sal.binding.api.MountPointService;
20 import org.opendaylight.controller.md.sal.binding.compat.HeliumRpcProviderRegistry;
21 import org.opendaylight.controller.md.sal.binding.impl.BindingDOMMountPointServiceAdapter;
22 import org.opendaylight.controller.md.sal.binding.impl.BindingDOMRpcProviderServiceAdapter;
23 import org.opendaylight.controller.md.sal.binding.impl.BindingDOMRpcServiceAdapter;
24 import org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec;
25 import org.opendaylight.controller.md.sal.dom.api.DOMMountPointService;
26 import org.opendaylight.controller.md.sal.dom.api.DOMRpcProviderService;
27 import org.opendaylight.controller.md.sal.dom.api.DOMRpcService;
28 import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
29 import org.opendaylight.controller.sal.binding.impl.RootBindingAwareBroker;
30 import org.opendaylight.controller.sal.core.api.Broker;
31 import org.opendaylight.controller.sal.core.api.Broker.ProviderSession;
36 * @deprecated Replaced by blueprint wiring
39 public final class BindingBrokerImplModule extends
40 org.opendaylight.controller.config.yang.md.sal.binding.impl.AbstractBindingBrokerImplModule {
42 public BindingBrokerImplModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier,
43 final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
44 super(identifier, dependencyResolver);
47 public BindingBrokerImplModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier,
48 final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver,
49 final BindingBrokerImplModule oldModule, final java.lang.AutoCloseable oldInstance) {
50 super(identifier, dependencyResolver, oldModule, oldInstance);
54 public void validate() {
59 public RootBindingAwareBroker createInstance() {
60 final Broker domBroker = getDomAsyncBrokerDependency();
61 final BindingToNormalizedNodeCodec codec = getBindingMappingServiceDependency();
62 final ProviderSession session = domBroker.registerProvider(new DummyDOMProvider());
64 final MountPointService mount = createMountPointAdapter(codec,session);
65 final BindingDOMRpcServiceAdapter rpcConsumer = createRpcConsumer(codec,session);
66 final BindingDOMRpcProviderServiceAdapter rpcProvider = createRpcProvider(codec,session);
67 final RootBindingAwareBroker broker = new RootBindingAwareBroker(getIdentifier().getInstanceName());
68 final RpcProviderRegistry heliumRpcBroker = new HeliumRpcProviderRegistry(rpcConsumer, rpcProvider);
70 broker.setNotificationBroker(getNotificationServiceDependency());
71 if (getNotificationPublishServiceDependency() != null) {
72 broker.setNotificationPublishService(getNotificationPublishServiceDependency());
74 broker.setRpcBroker(heliumRpcBroker);
75 broker.setDataBroker(getRootDataBrokerDependency());
76 broker.setMountService(mount);
81 private BindingDOMRpcProviderServiceAdapter createRpcProvider(final BindingToNormalizedNodeCodec codec,
82 final ProviderSession session) {
83 final DOMRpcProviderService domService = session.getService(DOMRpcProviderService.class);
84 if (domService != null) {
85 return new BindingDOMRpcProviderServiceAdapter(domService, codec);
90 private BindingDOMRpcServiceAdapter createRpcConsumer(final BindingToNormalizedNodeCodec codec,
91 final ProviderSession session) {
92 final DOMRpcService domService = session.getService(DOMRpcService.class);
93 if (domService != null) {
94 return new BindingDOMRpcServiceAdapter(domService, codec);
99 private MountPointService createMountPointAdapter(final BindingToNormalizedNodeCodec codec,
100 final ProviderSession session) {
101 final DOMMountPointService domService = session.getService(DOMMountPointService.class);
102 if (domService != null) {
103 return new BindingDOMMountPointServiceAdapter(domService, codec);