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
8 * Do not modify this file unless it is present under src/main directory
10 package org.opendaylight.controller.config.yang.md.sal.binding.impl;
12 import javassist.ClassPool;
14 import org.opendaylight.controller.sal.binding.dom.serializer.impl.RuntimeGeneratedMappingServiceImpl;
15 import org.osgi.framework.BundleContext;
17 import com.google.common.base.Preconditions;
22 public final class RuntimeMappingModule extends
23 org.opendaylight.controller.config.yang.md.sal.binding.impl.AbstractRuntimeMappingModule {
25 private BundleContext bundleContext;
27 public RuntimeMappingModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,
28 org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
29 super(identifier, dependencyResolver);
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);
39 public void validate() {
41 Preconditions.checkNotNull(bundleContext);
42 // Add custom validation for module attributes here.
46 public boolean canReuseInstance(AbstractRuntimeMappingModule oldModule) {
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());
59 private BundleContext getBundleContext() {
63 public void setBundleContext(BundleContext bundleContext) {
64 this.bundleContext = bundleContext;