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
8 * Do not modify this file unless it is present under src/main directory
10 package org.opendaylight.controller.config.yang.shutdown.impl;
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;
18 import java.util.Arrays;
21 public class ShutdownModuleFactory extends AbstractShutdownModuleFactory {
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);
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);
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));