shutdown-impl: final parameters
[controller.git] / opendaylight / config / shutdown-impl / src / main / java / org / opendaylight / controller / config / yang / shutdown / impl / ShutdownModule.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 /**
9  * Generated file
10
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
14  *
15  * Do not modify this file unless it is present under src/main directory
16  */
17 package org.opendaylight.controller.config.yang.shutdown.impl;
18
19 import org.opendaylight.controller.config.api.DependencyResolver;
20 import org.opendaylight.controller.config.api.JmxAttributeValidationException;
21 import org.opendaylight.controller.config.api.ModuleIdentifier;
22 import org.osgi.framework.Bundle;
23
24 public final class ShutdownModule extends AbstractShutdownModule {
25     private final Bundle systemBundle;
26
27     public ShutdownModule(final ModuleIdentifier identifier, final Bundle systemBundle) {
28         super(identifier, null);
29         singletonCheck(identifier);
30         this.systemBundle = systemBundle;
31     }
32
33     public ShutdownModule(final ModuleIdentifier identifier, final ShutdownModule oldModule, final java.lang.AutoCloseable oldInstance,
34                           final Bundle systemBundle) {
35         super(identifier, null, oldModule, oldInstance);
36         singletonCheck(identifier);
37         this.systemBundle = systemBundle;
38     }
39
40     private static void singletonCheck(final ModuleIdentifier identifier) {
41         if (AbstractShutdownModuleFactory.NAME.equals(identifier.getInstanceName()) == false) {
42             throw new IllegalArgumentException("Singleton enforcement failed. Expected instance name " + AbstractShutdownModuleFactory.NAME);
43         }
44     }
45
46     @Deprecated // needed for generated code
47     public ShutdownModule(final ModuleIdentifier identifier, final DependencyResolver dependencyResolver, final ShutdownModule oldModule,
48                           final AutoCloseable oldInstance) {
49         super(identifier, dependencyResolver, oldModule, oldInstance);
50         throw new UnsupportedOperationException();
51     }
52
53     @Deprecated // needed for generated code
54     public ShutdownModule(final ModuleIdentifier identifier, final DependencyResolver dependencyResolver) {
55         super(identifier, dependencyResolver);
56         throw new UnsupportedOperationException();
57     }
58
59     @Override
60     protected void customValidation() {
61         JmxAttributeValidationException.checkNotNull(super.getSecret(), secretJmxAttribute);
62     }
63
64     @Override
65     public java.lang.AutoCloseable createInstance() {
66         return new ShutdownServiceImpl(getSecret(), systemBundle, getRootRuntimeBeanRegistratorWrapper());
67     }
68 }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.