*/
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;
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.
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
*/
public OsgiRegistration registerToOsgi(
Class<? extends Module> configBeanClass, AutoCloseable instance,
- ModuleIdentifier moduleIdentifier) {
+ ModuleIdentifier moduleIdentifier, BundleContext bundleContext) {
try {
final Set<Class<?>> configuresInterfaces = InterfacesHelper
.getOsgiRegistrationTypes(configBeanClass);