import org.opendaylight.controller.config.spi.ModuleFactory;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleEvent;
import org.opendaylight.controller.config.spi.ModuleFactory;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleEvent;
private final BlankTransactionServiceTracker blankTransactionServiceTracker;
private static final Logger LOG = LoggerFactory.getLogger(ModuleFactoryBundleTracker.class);
private final BlankTransactionServiceTracker blankTransactionServiceTracker;
private static final Logger LOG = LoggerFactory.getLogger(ModuleFactoryBundleTracker.class);
URL resource = bundle.getEntry("META-INF/services/" + ModuleFactory.class.getName());
LOG.trace("Got addingBundle event of bundle {}, resource {}, event {}",
bundle, resource, event);
if (resource != null) {
try {
URL resource = bundle.getEntry("META-INF/services/" + ModuleFactory.class.getName());
LOG.trace("Got addingBundle event of bundle {}, resource {}, event {}",
bundle, resource, event);
if (resource != null) {
try {
} catch (IOException e) {
LOG.error("Error while reading {}", resource, e);
throw new RuntimeException(e);
}
}
} catch (IOException e) {
LOG.error("Error while reading {}", resource, e);
throw new RuntimeException(e);
}
}
- public void removedBundle(Bundle bundle, BundleEvent event, Object object) {
- // workaround for service tracker not getting removed service event
- blankTransactionServiceTracker.blankTransaction();
+ public void removedBundle(Bundle bundle, BundleEvent event, Boolean hasFactory) {
+ if(hasFactory) {
+ // workaround for service tracker not getting removed service event
+ blankTransactionServiceTracker.blankTransactionSync();
+ }
public static String logMessage(String slfMessage, Object... params) {
LOG.info(slfMessage, params);
String formatMessage = slfMessage.replaceAll("\\{\\}", "%s");
public static String logMessage(String slfMessage, Object... params) {
LOG.info(slfMessage, params);
String formatMessage = slfMessage.replaceAll("\\{\\}", "%s");