2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
11 * Generated from: yang module name: shutdown-impl yang module local name: shutdown
12 * Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
13 * Generated at: Wed Dec 18 14:02:06 CET 2013
15 * Do not modify this file unless it is present under src/main directory
17 package org.opendaylight.controller.config.yang.shutdown.impl;
19 import org.opendaylight.controller.config.api.DependencyResolver;
20 import org.opendaylight.controller.config.api.DependencyResolverFactory;
21 import org.opendaylight.controller.config.api.ModuleIdentifier;
22 import org.osgi.framework.Bundle;
23 import org.osgi.framework.BundleContext;
25 import java.util.Arrays;
28 public class ShutdownModuleFactory extends AbstractShutdownModuleFactory {
30 public ShutdownModule instantiateModule(String instanceName, DependencyResolver dependencyResolver,
31 ShutdownModule oldModule, AutoCloseable oldInstance,
32 BundleContext bundleContext) {
33 Bundle systemBundle = bundleContext.getBundle(0);
34 return new ShutdownModule(new ModuleIdentifier(NAME, instanceName), oldModule, oldInstance, systemBundle);
38 public ShutdownModule instantiateModule(String instanceName, DependencyResolver dependencyResolver,
39 BundleContext bundleContext) {
40 Bundle systemBundle = bundleContext.getBundle(0);
41 return new ShutdownModule(new ModuleIdentifier(NAME, instanceName), systemBundle);
45 public Set<ShutdownModule> getDefaultModules(DependencyResolverFactory dependencyResolverFactory, BundleContext bundleContext) {
46 ModuleIdentifier id = new ModuleIdentifier(NAME, NAME);
47 DependencyResolver dependencyResolver = dependencyResolverFactory.createDependencyResolver(id);
48 ShutdownModule shutdownModule = instantiateModule(NAME, dependencyResolver, bundleContext);
49 return new java.util.HashSet<>(Arrays.asList(shutdownModule));