Fixed bug in cross-broker RPC routing
[controller.git] / opendaylight / md-sal / sal-binding-broker / src / main / java / org / opendaylight / controller / config / yang / md / sal / binding / impl / RuntimeMappingModule.java
1 /**
2  * Generated file
3
4  * Generated from: yang module name: opendaylight-sal-binding-broker-impl  yang module local name: runtime-generated-mapping
5  * Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
6  * Generated at: Wed Nov 20 18:20:19 CET 2013
7  *
8  * Do not modify this file unless it is present under src/main directory
9  */
10 package org.opendaylight.controller.config.yang.md.sal.binding.impl;
11
12 import javassist.ClassPool;
13
14 import org.opendaylight.controller.sal.binding.codegen.impl.SingletonHolder;
15 import org.opendaylight.controller.sal.binding.dom.serializer.impl.RuntimeGeneratedMappingServiceImpl;
16 import org.osgi.framework.BundleContext;
17
18 import com.google.common.base.Preconditions;
19
20 /**
21 *
22 */
23 public final class RuntimeMappingModule extends
24         org.opendaylight.controller.config.yang.md.sal.binding.impl.AbstractRuntimeMappingModule {
25
26     private BundleContext bundleContext;
27
28     public RuntimeMappingModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,
29             org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
30         super(identifier, dependencyResolver);
31     }
32
33     public RuntimeMappingModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,
34             org.opendaylight.controller.config.api.DependencyResolver dependencyResolver,
35             RuntimeMappingModule oldModule, java.lang.AutoCloseable oldInstance) {
36         super(identifier, dependencyResolver, oldModule, oldInstance);
37     }
38
39     @Override
40     public void validate() {
41         super.validate();
42         Preconditions.checkNotNull(bundleContext);
43         // Add custom validation for module attributes here.
44     }
45
46     @Override
47     public boolean canReuseInstance(AbstractRuntimeMappingModule oldModule) {
48         return true;
49     }
50
51     @Override
52     public java.lang.AutoCloseable createInstance() {
53         RuntimeGeneratedMappingServiceImpl service = new RuntimeGeneratedMappingServiceImpl();
54         service.setPool(SingletonHolder.CLASS_POOL);
55         service.start(getBundleContext());
56         return service;
57     }
58
59     private BundleContext getBundleContext() {
60         return bundleContext;
61     }
62
63     public void setBundleContext(BundleContext bundleContext) {
64         this.bundleContext = bundleContext;
65     }
66 }