Statistics-Manager - Performance Improvement
[controller.git] / opendaylight / config / config-manager / src / main / java / org / opendaylight / controller / config / manager / impl / osgi / BeanToOsgiServiceManager.java
index 42f8b8790bb666e9fa29761faa5e47169964d4aa..41f577844af5ed448a322a9a21f2f410782632cd 100644 (file)
@@ -7,11 +7,6 @@
  */
 package org.opendaylight.controller.config.manager.impl.osgi;
 
-import java.util.Dictionary;
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.Set;
-
 import org.opendaylight.controller.config.api.ModuleIdentifier;
 import org.opendaylight.controller.config.api.annotations.ServiceInterfaceAnnotation;
 import org.opendaylight.controller.config.manager.impl.util.InterfacesHelper;
@@ -19,6 +14,11 @@ import org.opendaylight.controller.config.spi.Module;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceRegistration;
 
+import java.util.Dictionary;
+import java.util.HashSet;
+import java.util.Hashtable;
+import java.util.Set;
+
 /**
  * Registers instantiated beans as OSGi services and unregisters these services
  * if beans are destroyed.
@@ -28,12 +28,6 @@ public class BeanToOsgiServiceManager {
     static final String INSTANCE_NAME_OSGI_PROP = "instanceName";
     static final String IMPLEMENTATION_NAME_OSGI_PROP = "implementationName";
 
-    private final BundleContext bundleContext;
-
-    public BeanToOsgiServiceManager(BundleContext context) {
-        this.bundleContext = context;
-    }
-
     /**
      * To be called for every created, reconfigured and recreated config bean.
      * It is expected that before using this method OSGi service registry will
@@ -41,7 +35,7 @@ public class BeanToOsgiServiceManager {
      */
     public OsgiRegistration registerToOsgi(
             Class<? extends Module> configBeanClass, AutoCloseable instance,
-            ModuleIdentifier moduleIdentifier) {
+            ModuleIdentifier moduleIdentifier, BundleContext bundleContext) {
         try {
             final Set<Class<?>> configuresInterfaces = InterfacesHelper
                     .getOsgiRegistrationTypes(configBeanClass);