2 * Copyright (c) 2015 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
9 package org.opendaylight.controller.config.yang.messagebus.netconf;
11 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
12 import org.opendaylight.controller.md.sal.binding.api.MountPointService;
13 import org.opendaylight.controller.md.sal.dom.api.DOMMountPointService;
14 import org.opendaylight.controller.md.sal.dom.api.DOMNotificationPublishService;
15 import org.opendaylight.controller.messagebus.app.util.Providers;
16 import org.opendaylight.netconf.messagebus.eventsources.netconf.NetconfEventSourceManager;
17 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
18 import org.opendaylight.controller.sal.core.api.Broker;
20 public class MessageBusNetconfModule extends org.opendaylight.controller.config.yang.messagebus.netconf.AbstractMessageBusNetconfModule {
21 public MessageBusNetconfModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
22 super(identifier, dependencyResolver);
25 public MessageBusNetconfModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.controller.config.yang.messagebus.netconf.MessageBusNetconfModule oldModule, java.lang.AutoCloseable oldInstance) {
26 super(identifier, dependencyResolver, oldModule, oldInstance);
30 public void customValidation() {}
33 public java.lang.AutoCloseable createInstance() {
34 final BindingAwareBroker.ProviderContext bindingCtx = getBindingBrokerDependency().registerProvider(new Providers.BindingAware());
35 final Broker.ProviderSession domCtx = getDomBrokerDependency().registerProvider(new Providers.BindingIndependent());
37 final MountPointService mountPointService = bindingCtx.getSALService(MountPointService.class);
38 final DataBroker dataBroker = bindingCtx.getSALService(DataBroker.class);
40 final DOMNotificationPublishService domPublish = domCtx.getService(DOMNotificationPublishService.class);
41 final DOMMountPointService domMount = domCtx.getService(DOMMountPointService.class);
43 return NetconfEventSourceManager.create(dataBroker, domPublish, domMount,
44 mountPointService, getEventSourceRegistryDependency(), getNamespaceToStream());