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 abef4d2fc4a775a26e920932c9e5f7e96622c11a..267e504f859fe3bd024bf5eb2d098fdb4904e935 100644 (file)
@@ -44,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) {
 
@@ -52,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;
@@ -114,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