Add shutdown hook.
[controller.git] / opendaylight / config / shutdown-impl / src / main / java / org / opendaylight / controller / config / yang / shutdown / impl / ShutdownModuleFactory.java
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
new file mode 100644 (file)
index 0000000..637395b
--- /dev/null
@@ -0,0 +1,49 @@
+/**
+ * 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
+ *
+ * Do not modify this file unless it is present under src/main directory
+ */
+package org.opendaylight.controller.config.yang.shutdown.impl;
+
+import org.opendaylight.controller.config.api.DependencyResolver;
+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) {
+        Bundle systemBundle = bundleContext.getBundle(0);
+        return new ShutdownModule(new ModuleIdentifier(NAME, instanceName), oldModule, oldInstance, systemBundle);
+    }
+
+
+    public ShutdownModule instantiateModule(String instanceName, DependencyResolver dependencyResolver,
+                                            BundleContext bundleContext) {
+        Bundle systemBundle = bundleContext.getBundle(0);
+        return new ShutdownModule(new ModuleIdentifier(NAME, instanceName), systemBundle);
+    }
+}