X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=opendaylight%2Fconfig%2Fshutdown-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfig%2Fyang%2Fshutdown%2Fimpl%2FShutdownModuleFactory.java;h=1994e21a6de9680eb9ac8ad851d8e5fa9893581c;hb=b5167b9bc04f2792b275cfe0eac78c0f5eb9442d;hp=637395bc48f334eda60084f4404f94577d1c2ac7;hpb=91d7c1ee52322acad08e9f81228ac36b3aa684f5;p=controller.git diff --git a/opendaylight/config/shutdown-impl/src/main/java/org/opendaylight/controller/config/yang/shutdown/impl/ShutdownModuleFactory.java b/opendaylight/config/shutdown-impl/src/main/java/org/opendaylight/controller/config/yang/shutdown/impl/ShutdownModuleFactory.java index 637395bc48..1994e21a6d 100644 --- a/opendaylight/config/shutdown-impl/src/main/java/org/opendaylight/controller/config/yang/shutdown/impl/ShutdownModuleFactory.java +++ b/opendaylight/config/shutdown-impl/src/main/java/org/opendaylight/controller/config/yang/shutdown/impl/ShutdownModuleFactory.java @@ -1,38 +1,22 @@ -/** - * Generated file - - * Generated from: yang module name: shutdown-impl yang module local name: shutdown - * Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator - * Generated at: Wed Dec 18 14:02:06 CET 2013 +/* + * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. * - * Do not modify this file unless it is present under src/main directory + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html */ package org.opendaylight.controller.config.yang.shutdown.impl; +import java.util.Arrays; +import java.util.Set; import org.opendaylight.controller.config.api.DependencyResolver; +import org.opendaylight.controller.config.api.DependencyResolverFactory; import org.opendaylight.controller.config.api.ModuleIdentifier; import org.osgi.framework.Bundle; import org.osgi.framework.BundleContext; public class ShutdownModuleFactory extends AbstractShutdownModuleFactory { - @Override - public org.opendaylight.controller.config.spi.Module createModule(String instanceName, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.controller.config.api.DynamicMBeanWithInstance old, org.osgi.framework.BundleContext bundleContext) throws Exception { - org.opendaylight.controller.config.yang.shutdown.impl.ShutdownModule oldModule = null; - try { - oldModule = (org.opendaylight.controller.config.yang.shutdown.impl.ShutdownModule) old.getModule(); - } catch(Exception e) { - return handleChangedClass(old); - } - org.opendaylight.controller.config.yang.shutdown.impl.ShutdownModule module = instantiateModule(instanceName, dependencyResolver, oldModule, old.getInstance(), bundleContext); - - module.setOldSecret(oldModule.getActualOldSecret()); - module.setSecret(oldModule.getActualSecret()); - - return module; - } - - public ShutdownModule instantiateModule(String instanceName, DependencyResolver dependencyResolver, ShutdownModule oldModule, AutoCloseable oldInstance, BundleContext bundleContext) { @@ -46,4 +30,12 @@ public class ShutdownModuleFactory extends AbstractShutdownModuleFactory { Bundle systemBundle = bundleContext.getBundle(0); return new ShutdownModule(new ModuleIdentifier(NAME, instanceName), systemBundle); } + + @Override + public Set getDefaultModules(DependencyResolverFactory dependencyResolverFactory, BundleContext bundleContext) { + ModuleIdentifier id = new ModuleIdentifier(NAME, NAME); + DependencyResolver dependencyResolver = dependencyResolverFactory.createDependencyResolver(id); + ShutdownModule shutdownModule = instantiateModule(NAME, dependencyResolver, bundleContext); + return new java.util.HashSet<>(Arrays.asList(shutdownModule)); + } }