import java.util.List;
import org.apache.commons.io.IOUtils;
-import org.opendaylight.controller.config.api.jmx.CommitStatus;
-import org.opendaylight.controller.config.manager.impl.ConfigRegistryImpl;
import org.opendaylight.controller.config.spi.ModuleFactory;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleEvent;
-import org.osgi.framework.BundleException;
import org.osgi.framework.ServiceRegistration;
import org.osgi.util.tracker.BundleTracker;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import javax.management.ObjectName;
/**
* OSGi extender that listens for bundle activation events. Reads file
* Code based on http://www.toedter.com/blog/?p=236
*/
public class ExtenderBundleTracker extends BundleTracker<Object> {
-
+ private final BlankTransactionServiceTracker blankTransactionServiceTracker;
private static final Logger logger = LoggerFactory.getLogger(ExtenderBundleTracker.class);
- public ExtenderBundleTracker(BundleContext context) {
+ public ExtenderBundleTracker(BundleContext context, BlankTransactionServiceTracker blankTransactionServiceTracker) {
super(context, Bundle.ACTIVE, null);
+ this.blankTransactionServiceTracker = blankTransactionServiceTracker;
logger.trace("Registered as extender with context {}", context);
}
@Override
public void removedBundle(Bundle bundle, BundleEvent event, Object object) {
super.removedBundle(bundle,event,object);
+ // workaround for service tracker not getting removed service event
+ blankTransactionServiceTracker.blankTransaction();
}
// TODO:test