Bug 488: Removed BundleContext usage for registering to DOM Components.
[controller.git] / opendaylight / md-sal / sal-binding-broker / src / main / java / org / opendaylight / controller / config / yang / md / sal / binding / impl / BindingAsyncDataBrokerImplModule.java
1 package org.opendaylight.controller.config.yang.md.sal.binding.impl;
2
3 import java.util.Collection;
4 import java.util.Collections;
5
6 import org.opendaylight.controller.md.sal.binding.impl.ForwardedBindingDataBroker;
7 import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
8 import org.opendaylight.controller.sal.core.api.Broker;
9 import org.opendaylight.controller.sal.core.api.Broker.ProviderSession;
10 import org.opendaylight.controller.sal.core.api.Provider;
11 import org.opendaylight.controller.sal.core.api.model.SchemaService;
12 import org.opendaylight.yangtools.yang.data.impl.codec.BindingIndependentMappingService;
13
14 public class BindingAsyncDataBrokerImplModule extends
15         org.opendaylight.controller.config.yang.md.sal.binding.impl.AbstractBindingAsyncDataBrokerImplModule implements
16         Provider {
17
18     public BindingAsyncDataBrokerImplModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier,
19             final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
20         super(identifier, dependencyResolver);
21     }
22
23     public BindingAsyncDataBrokerImplModule(
24             final org.opendaylight.controller.config.api.ModuleIdentifier identifier,
25             final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver,
26             final org.opendaylight.controller.config.yang.md.sal.binding.impl.BindingAsyncDataBrokerImplModule oldModule,
27             final java.lang.AutoCloseable oldInstance) {
28         super(identifier, dependencyResolver, oldModule, oldInstance);
29     }
30
31     @Override
32     public void customValidation() {
33         // add custom validation form module attributes here.
34     }
35
36     @Override
37     public java.lang.AutoCloseable createInstance() {
38         Broker domBroker = getDomAsyncBrokerDependency();
39         BindingIndependentMappingService mappingService = getBindingMappingServiceDependency();
40
41         // FIXME: Switch this to DOM Broker registration which would not require
42         // BundleContext when API are updated.
43         ProviderSession session = domBroker.registerProvider(this, null);
44         DOMDataBroker domDataBroker = session.getService(DOMDataBroker.class);
45         SchemaService schemaService = session.getService(SchemaService.class);
46         return new ForwardedBindingDataBroker(domDataBroker, mappingService, schemaService);
47     }
48
49
50
51
52
53     @Override
54     public Collection<ProviderFunctionality> getProviderFunctionality() {
55         return Collections.emptySet();
56     }
57
58     @Override
59     public void onSessionInitiated(final ProviderSession arg0) {
60         // intentional NOOP
61     }
62
63 }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.