Bug 8662 RefreshingSCPModuleInfoRegistry synchronized
[controller.git] / opendaylight / config / config-manager / src / main / java / org / opendaylight / controller / config / manager / impl / ModuleInternalInfo.java
index 76299e67a287fc922dbd034bddeeecd8df361602..a64d8c33b865e18337b2433a388bfc0e6fff98a5 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;
@@ -42,21 +41,17 @@ public class ModuleInternalInfo implements Comparable<ModuleInternalInfo>,
     private final ModuleFactory moduleFactory;
     private final BundleContext bundleContext;
 
-    public ModuleInternalInfo(ModuleIdentifier name,
-            @Nullable DynamicReadableWrapper readableModule,
-            OsgiRegistration osgiRegistration,
-            RootRuntimeBeanRegistratorImpl runtimeBeanRegistrator,
-            ModuleJMXRegistrator moduleJMXRegistrator, int orderingIdx,
-            boolean isDefaultBean, ModuleFactory moduleFactory, BundleContext bundleContext) {
+    public ModuleInternalInfo(final ModuleIdentifier name,
+            @Nullable final DynamicReadableWrapper readableModule,
+            final OsgiRegistration osgiRegistration,
+            @Nullable final RootRuntimeBeanRegistratorImpl runtimeBeanRegistrator,
+            final ModuleJMXRegistrator moduleJMXRegistrator, final int orderingIdx,
+            final boolean isDefaultBean, final ModuleFactory moduleFactory, final BundleContext bundleContext) {
 
         if (osgiRegistration == null) {
             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;
@@ -108,14 +103,14 @@ public class ModuleInternalInfo implements Comparable<ModuleInternalInfo>,
      * Compare using orderingIdx
      */
     @Override
-    public int compareTo(ModuleInternalInfo o) {
+    public int compareTo(final ModuleInternalInfo o) {
         return Integer.compare(orderingIdx, o.orderingIdx);
     }
 
     public DestroyedModule toDestroyedModule() {
         return new DestroyedModule(getIdentifier(),
                 getReadableModule().getInstance(), getModuleJMXRegistrator(),
-                getOsgiRegistration(), getOrderingIdx());
+                getOsgiRegistration(), getOrderingIdx(), runtimeBeanRegistrator);
     }
 
     @Override