/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2013, 2017 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,
package org.opendaylight.controller.config.manager.impl.dependencyresolver;
import com.google.common.base.Preconditions;
+import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.opendaylight.controller.config.api.ModuleIdentifier;
import org.opendaylight.controller.config.manager.impl.ModuleInternalInfo;
public class ModuleInternalTransactionalInfo implements Identifiable<ModuleIdentifier> {
private final ModuleIdentifier name;
- private final Module proxiedModule, realModule;
+ private final Module proxiedModule;
+ private final Module realModule;
private final ModuleFactory moduleFactory;
- @Nullable
- private final ModuleInternalInfo maybeOldInternalInfo;
+
private final TransactionModuleJMXRegistration transactionModuleJMXRegistration;
private final boolean isDefaultBean;
private final BundleContext bundleContext;
+ @Nullable private ModuleInternalInfo maybeOldInternalInfo;
- public ModuleInternalTransactionalInfo(ModuleIdentifier name, Module proxiedModule,
- ModuleFactory moduleFactory,
- ModuleInternalInfo maybeOldInternalInfo,
- TransactionModuleJMXRegistration transactionModuleJMXRegistration,
- boolean isDefaultBean, Module realModule, BundleContext bundleContext) {
+ public ModuleInternalTransactionalInfo(final ModuleIdentifier name, final Module proxiedModule,
+ final ModuleFactory moduleFactory,
+ final ModuleInternalInfo maybeOldInternalInfo,
+ final TransactionModuleJMXRegistration transactionModuleJMXRegistration,
+ final boolean isDefaultBean,
+ final Module realModule,
+ final BundleContext bundleContext) {
this.name = name;
this.proxiedModule = proxiedModule;
this.moduleFactory = moduleFactory;
return new DestroyedModule(name, oldModule.getInstance(),
maybeOldInternalInfo.getModuleJMXRegistrator(),
maybeOldInternalInfo.getOsgiRegistration(),
- maybeOldInternalInfo.getOrderingIdx());
+ maybeOldInternalInfo.getOrderingIdx(), maybeOldInternalInfo.getRuntimeBeanRegistrator());
}
return moduleFactory;
}
- @Nullable
- public ModuleInternalInfo getOldInternalInfo() {
+ @Nonnull public ModuleInternalInfo getOldInternalInfo() {
return Preconditions.checkNotNull(maybeOldInternalInfo);
}
+ public void clearOldInternalInfo() {
+ Preconditions.checkState(maybeOldInternalInfo != null, "No old internal info present");
+ maybeOldInternalInfo = null;
+ }
+
public TransactionModuleJMXRegistration getTransactionModuleJMXRegistration() {
return transactionModuleJMXRegistration;
}