Fixed netconf monitoring.
[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.dom.serializer.impl.RuntimeGeneratedMappingServiceImpl;
15 import org.osgi.framework.BundleContext;
16
17 import com.google.common.base.Preconditions;
18
19 /**
20 *
21 */
22 public final class RuntimeMappingModule extends
23         org.opendaylight.controller.config.yang.md.sal.binding.impl.AbstractRuntimeMappingModule {
24
25     private BundleContext bundleContext;
26
27     public RuntimeMappingModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,
28             org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
29         super(identifier, dependencyResolver);
30     }
31
32     public RuntimeMappingModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,
33             org.opendaylight.controller.config.api.DependencyResolver dependencyResolver,
34             RuntimeMappingModule oldModule, java.lang.AutoCloseable oldInstance) {
35         super(identifier, dependencyResolver, oldModule, oldInstance);
36     }
37
38     @Override
39     public void validate() {
40         super.validate();
41         Preconditions.checkNotNull(bundleContext);
42         // Add custom validation for module attributes here.
43     }
44
45     @Override
46     public boolean canReuseInstance(AbstractRuntimeMappingModule oldModule) {
47         return true;
48     }
49
50     @Override
51     public java.lang.AutoCloseable createInstance() {
52         RuntimeGeneratedMappingServiceImpl service = new RuntimeGeneratedMappingServiceImpl();
53         ClassPool pool = new ClassPool(); // Should be default singleton
54         service.setPool(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 }