Merge "Fixed NetconfDevice to store capability info."
[controller.git] / opendaylight / config / shutdown-impl / src / main / java / org / opendaylight / controller / config / yang / shutdown / impl / ShutdownModule.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.JmxAttributeValidationException;
14 import org.opendaylight.controller.config.api.ModuleIdentifier;
15 import org.osgi.framework.Bundle;
16
17 public final class ShutdownModule extends AbstractShutdownModule {
18     private final Bundle systemBundle;
19
20     public ShutdownModule(ModuleIdentifier identifier, Bundle systemBundle) {
21         super(identifier, null);
22         singletonCheck(identifier);
23         this.systemBundle = systemBundle;
24     }
25
26     public ShutdownModule(ModuleIdentifier identifier, ShutdownModule oldModule, java.lang.AutoCloseable oldInstance,
27                           Bundle systemBundle) {
28         super(identifier, null, oldModule, oldInstance);
29         singletonCheck(identifier);
30         this.systemBundle = systemBundle;
31     }
32
33     private static void singletonCheck(ModuleIdentifier identifier) {
34         if (AbstractShutdownModuleFactory.NAME.equals(identifier.getInstanceName()) == false) {
35             throw new IllegalArgumentException("Singleton enforcement failed. Expected instance name " + AbstractShutdownModuleFactory.NAME);
36         }
37     }
38
39     @Deprecated // needed for generated code
40     public ShutdownModule(ModuleIdentifier identifier, DependencyResolver dependencyResolver, ShutdownModule oldModule,
41                           AutoCloseable oldInstance) {
42         super(identifier, dependencyResolver, oldModule, oldInstance);
43         throw new UnsupportedOperationException();
44     }
45
46     @Deprecated // needed for generated code
47     public ShutdownModule(ModuleIdentifier identifier, DependencyResolver dependencyResolver) {
48         super(identifier, dependencyResolver);
49         throw new UnsupportedOperationException();
50     }
51
52     @Override
53     protected void customValidation() {
54         JmxAttributeValidationException.checkNotNull(super.getSecret(), secretJmxAttribute);
55     }
56
57     @Override
58     public java.lang.AutoCloseable createInstance() {
59         return new ShutdownServiceImpl(getSecret(), systemBundle, getRootRuntimeBeanRegistratorWrapper());
60     }
61 }