Merge "Update ietf yang dependencies from rev130712 to rev131021."
[controller.git] / opendaylight / config / shutdown-impl / src / main / java / org / opendaylight / controller / config / yang / shutdown / impl / ShutdownModuleFactory.java
1 /**
2  * Generated file
3
4  * Generated from: yang module name: shutdown-impl  yang module local name: shutdown
5  * Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
6  * Generated at: Wed Dec 18 14:02:06 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.shutdown.impl;
11
12 import org.opendaylight.controller.config.api.DependencyResolver;
13 import org.opendaylight.controller.config.api.DependencyResolverFactory;
14 import org.opendaylight.controller.config.api.ModuleIdentifier;
15 import org.osgi.framework.Bundle;
16 import org.osgi.framework.BundleContext;
17
18 import java.util.Arrays;
19 import java.util.Set;
20
21 public class ShutdownModuleFactory extends AbstractShutdownModuleFactory {
22
23     public ShutdownModule instantiateModule(String instanceName, DependencyResolver dependencyResolver,
24                                             ShutdownModule oldModule, AutoCloseable oldInstance,
25                                             BundleContext bundleContext) {
26         Bundle systemBundle = bundleContext.getBundle(0);
27         return new ShutdownModule(new ModuleIdentifier(NAME, instanceName), oldModule, oldInstance, systemBundle);
28     }
29
30
31     public ShutdownModule instantiateModule(String instanceName, DependencyResolver dependencyResolver,
32                                             BundleContext bundleContext) {
33         Bundle systemBundle = bundleContext.getBundle(0);
34         return new ShutdownModule(new ModuleIdentifier(NAME, instanceName), systemBundle);
35     }
36
37     @Override
38     public Set<ShutdownModule> getDefaultModules(DependencyResolverFactory dependencyResolverFactory, BundleContext bundleContext) {
39         ModuleIdentifier id = new ModuleIdentifier(NAME, NAME);
40         DependencyResolver dependencyResolver = dependencyResolverFactory.createDependencyResolver(id);
41         ShutdownModule shutdownModule = instantiateModule(NAME, dependencyResolver, bundleContext);
42         return new java.util.HashSet<>(Arrays.asList(shutdownModule));
43     }
44 }