Introduce lifecycle to runtime beans registrator in config-manager
[controller.git] / opendaylight / config / config-manager / src / main / java / org / opendaylight / controller / config / manager / impl / ModuleInternalInfo.java
index 76299e67a287fc922dbd034bddeeecd8df361602..267e504f859fe3bd024bf5eb2d098fdb4904e935 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.controller.config.manager.impl;
 
 import javax.annotation.Nullable;
-
 import org.opendaylight.controller.config.api.ModuleIdentifier;
 import org.opendaylight.controller.config.manager.impl.dependencyresolver.DestroyedModule;
 import org.opendaylight.controller.config.manager.impl.dynamicmbean.DynamicReadableWrapper;
@@ -45,7 +44,7 @@ public class ModuleInternalInfo implements Comparable<ModuleInternalInfo>,
     public ModuleInternalInfo(ModuleIdentifier name,
             @Nullable DynamicReadableWrapper readableModule,
             OsgiRegistration osgiRegistration,
-            RootRuntimeBeanRegistratorImpl runtimeBeanRegistrator,
+            @Nullable RootRuntimeBeanRegistratorImpl runtimeBeanRegistrator,
             ModuleJMXRegistrator moduleJMXRegistrator, int orderingIdx,
             boolean isDefaultBean, ModuleFactory moduleFactory, BundleContext bundleContext) {
 
@@ -53,10 +52,6 @@ public class ModuleInternalInfo implements Comparable<ModuleInternalInfo>,
             throw new IllegalArgumentException(
                     "Parameter 'osgiRegistration' is missing");
         }
-        if (runtimeBeanRegistrator == null) {
-            throw new IllegalArgumentException(
-                    "Parameter 'runtimeBeanRegistrator' is missing");
-        }
         this.readableModule = readableModule;
         this.osgiRegistration = osgiRegistration;
         this.runtimeBeanRegistrator = runtimeBeanRegistrator;
@@ -115,7 +110,7 @@ public class ModuleInternalInfo implements Comparable<ModuleInternalInfo>,
     public DestroyedModule toDestroyedModule() {
         return new DestroyedModule(getIdentifier(),
                 getReadableModule().getInstance(), getModuleJMXRegistrator(),
-                getOsgiRegistration(), getOrderingIdx());
+                getOsgiRegistration(), getOrderingIdx(), runtimeBeanRegistrator);
     }
 
     @Override