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.JmxAttributeValidationException;
21 import org.opendaylight.controller.config.api.ModuleIdentifier;
22 import org.osgi.framework.Bundle;
24 public final class ShutdownModule extends AbstractShutdownModule {
25 private final Bundle systemBundle;
27 public ShutdownModule(ModuleIdentifier identifier, Bundle systemBundle) {
28 super(identifier, null);
29 singletonCheck(identifier);
30 this.systemBundle = systemBundle;
33 public ShutdownModule(ModuleIdentifier identifier, ShutdownModule oldModule, java.lang.AutoCloseable oldInstance,
34 Bundle systemBundle) {
35 super(identifier, null, oldModule, oldInstance);
36 singletonCheck(identifier);
37 this.systemBundle = systemBundle;
40 private static void singletonCheck(ModuleIdentifier identifier) {
41 if (AbstractShutdownModuleFactory.NAME.equals(identifier.getInstanceName()) == false) {
42 throw new IllegalArgumentException("Singleton enforcement failed. Expected instance name " + AbstractShutdownModuleFactory.NAME);
46 @Deprecated // needed for generated code
47 public ShutdownModule(ModuleIdentifier identifier, DependencyResolver dependencyResolver, ShutdownModule oldModule,
48 AutoCloseable oldInstance) {
49 super(identifier, dependencyResolver, oldModule, oldInstance);
50 throw new UnsupportedOperationException();
53 @Deprecated // needed for generated code
54 public ShutdownModule(ModuleIdentifier identifier, DependencyResolver dependencyResolver) {
55 super(identifier, dependencyResolver);
56 throw new UnsupportedOperationException();
60 protected void customValidation() {
61 JmxAttributeValidationException.checkNotNull(super.getSecret(), secretJmxAttribute);
65 public java.lang.AutoCloseable createInstance() {
66 return new ShutdownServiceImpl(getSecret(), systemBundle, getRootRuntimeBeanRegistratorWrapper());