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 java.util.Collections;
15 import org.opendaylight.controller.config.api.DependencyResolver;
16 import org.opendaylight.controller.config.api.DependencyResolverFactory;
17 import org.opendaylight.controller.config.api.DynamicMBeanWithInstance;
18 import org.opendaylight.controller.config.api.ModuleIdentifier;
19 import org.opendaylight.controller.config.spi.Module;
20 import org.osgi.framework.BundleContext;
25 public class RuntimeMappingModuleFactory extends org.opendaylight.controller.config.yang.md.sal.binding.impl.AbstractRuntimeMappingModuleFactory
29 private static RuntimeMappingModule SINGLETON = null;
30 private static ModuleIdentifier IDENTIFIER = new ModuleIdentifier(NAME, "runtime-mapping-singleton");
33 public Module createModule(String instanceName, DependencyResolver dependencyResolver, BundleContext bundleContext) {
34 throw new UnsupportedOperationException("Only default instance supported");
38 public Module createModule(String instanceName, DependencyResolver dependencyResolver,
39 DynamicMBeanWithInstance old, BundleContext bundleContext) throws Exception {
40 RuntimeMappingModule module = (RuntimeMappingModule) super.createModule(instanceName, dependencyResolver, old, bundleContext);
41 module.setBundleContext(bundleContext);
46 public Set<RuntimeMappingModule> getDefaultModules(DependencyResolverFactory dependencyResolverFactory,
47 BundleContext bundleContext) {
48 if(SINGLETON == null) {
49 DependencyResolver dependencyResolver = dependencyResolverFactory.createDependencyResolver(IDENTIFIER);
50 SINGLETON = new RuntimeMappingModule(IDENTIFIER , dependencyResolver);
51 SINGLETON.setBundleContext(bundleContext);
55 return Collections.singleton(SINGLETON);