+/*
+ * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * 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
+ */
/**
* Generated file
public final class ShutdownModule extends AbstractShutdownModule {
private final Bundle systemBundle;
- private final ShutdownModule nullableOldModule;
- public ShutdownModule(ModuleIdentifier identifier, Bundle systemBundle) {
+ public ShutdownModule(final ModuleIdentifier identifier, final Bundle systemBundle) {
super(identifier, null);
singletonCheck(identifier);
this.systemBundle = systemBundle;
- this.nullableOldModule = null;
}
- public ShutdownModule(ModuleIdentifier identifier, ShutdownModule oldModule, java.lang.AutoCloseable oldInstance,
- Bundle systemBundle) {
+ public ShutdownModule(final ModuleIdentifier identifier, final ShutdownModule oldModule, final java.lang.AutoCloseable oldInstance,
+ final Bundle systemBundle) {
super(identifier, null, oldModule, oldInstance);
singletonCheck(identifier);
this.systemBundle = systemBundle;
- this.nullableOldModule = oldModule;
}
- private static void singletonCheck(ModuleIdentifier identifier) {
+ private static void singletonCheck(final ModuleIdentifier identifier) {
if (AbstractShutdownModuleFactory.NAME.equals(identifier.getInstanceName()) == false) {
throw new IllegalArgumentException("Singleton enforcement failed. Expected instance name " + AbstractShutdownModuleFactory.NAME);
}
}
@Deprecated // needed for generated code
- public ShutdownModule(ModuleIdentifier identifier, DependencyResolver dependencyResolver, ShutdownModule oldModule,
- AutoCloseable oldInstance) {
+ public ShutdownModule(final ModuleIdentifier identifier, final DependencyResolver dependencyResolver, final ShutdownModule oldModule,
+ final AutoCloseable oldInstance) {
super(identifier, dependencyResolver, oldModule, oldInstance);
throw new UnsupportedOperationException();
}
@Deprecated // needed for generated code
- public ShutdownModule(ModuleIdentifier identifier, DependencyResolver dependencyResolver) {
+ public ShutdownModule(final ModuleIdentifier identifier, final DependencyResolver dependencyResolver) {
super(identifier, dependencyResolver);
throw new UnsupportedOperationException();
}
- @Override
- public String getSecret() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String getOldSecret() {
- throw new UnsupportedOperationException();
- }
-
- String getActualSecret() {
- return super.getSecret();
- }
-
- String getActualOldSecret() {
- return super.getOldSecret();
- }
-
@Override
protected void customValidation() {
- JmxAttributeValidationException.checkNotNull(super.getOldSecret(), oldSecretJmxAttribute);
JmxAttributeValidationException.checkNotNull(super.getSecret(), secretJmxAttribute);
- if (nullableOldModule != null) {
- // if nothing changed, remain valid
- boolean sameAsOldModule = isSame(nullableOldModule);
- if (sameAsOldModule == false) {
- boolean valid = getActualOldSecret().equals(nullableOldModule.getActualSecret());
- JmxAttributeValidationException.checkCondition(valid, "Invalid old secret", oldSecretJmxAttribute);
- }
- }
}
@Override
public java.lang.AutoCloseable createInstance() {
- return new ShutdownServiceImpl(getActualSecret(), systemBundle, getRootRuntimeBeanRegistratorWrapper());
+ return new ShutdownServiceImpl(getSecret(), systemBundle, getRootRuntimeBeanRegistratorWrapper());
}
}