Merge changes I0f752636,Idd154499,Ic35fa3e8
[controller.git] / opendaylight / md-sal / sal-dom-broker / src / main / java / org / opendaylight / controller / config / yang / md / sal / dom / impl / SchemaServiceImplSingletonModuleFactory.java
1 /**
2  * Generated file
3
4  * Generated from: yang module name: opendaylight-sal-dom-broker-impl  yang module local name: schema-service-singleton
5  * Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
6  * Generated at: Wed Nov 20 17:01:31 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.dom.impl;
11
12 import java.util.Collections;
13 import java.util.Set;
14
15 import org.opendaylight.controller.config.api.DependencyResolver;
16 import org.opendaylight.controller.config.api.DependencyResolverFactory;
17 import org.opendaylight.controller.config.api.ModuleIdentifier;
18 import org.opendaylight.controller.config.spi.Module;
19 import org.osgi.framework.BundleContext;
20
21 /**
22 *
23 */
24 public class SchemaServiceImplSingletonModuleFactory extends
25         org.opendaylight.controller.config.yang.md.sal.dom.impl.AbstractSchemaServiceImplSingletonModuleFactory {
26
27     private static final ModuleIdentifier IDENTIFIER = new ModuleIdentifier(NAME, "yang-schema-service");
28     public static SchemaServiceImplSingletonModule SINGLETON;
29
30     @Override
31     public Module createModule(String instanceName, DependencyResolver dependencyResolver, BundleContext bundleContext) {
32         throw new UnsupportedOperationException("Only default instance supported.");
33     }
34
35     @Override
36     public Set<SchemaServiceImplSingletonModule> getDefaultModules(DependencyResolverFactory dependencyResolverFactory,
37             BundleContext bundleContext) {
38         DependencyResolver dependencyResolver = dependencyResolverFactory.createDependencyResolver(IDENTIFIER);
39
40         if (SINGLETON == null) {
41             SINGLETON = new SchemaServiceImplSingletonModule(IDENTIFIER, dependencyResolver);
42             SINGLETON.setBundleContext(bundleContext);
43         }
44         return Collections.singleton(SINGLETON);
45     }
46 }