// restart config modules.
final CountDownLatch containerCreationComplete = new CountDownLatch(containerBundles.size());
ServiceRegistration<?> eventHandlerReg = registerEventHandler(forBundle.getBundleContext(), event -> {
- LOG.debug("handleEvent {} for bundle {}", event.getTopic(), event.getProperty(EventConstants.BUNDLE));
- if (containerBundles.contains(event.getProperty(EventConstants.BUNDLE))) {
+ final Bundle bundle = (Bundle) event.getProperty(EventConstants.BUNDLE);
+ LOG.debug("handleEvent {} for bundle {}", event.getTopic(), bundle);
+ if (containerBundles.contains(bundle)) {
containerCreationComplete.countDown();
}
});
return;
}
- ConfigSubsystemFacade configFacade = configFacadeFactory.createFacade("BlueprintContainerRestartService");
- try {
+ try (ConfigSubsystemFacade configFacade = configFacadeFactory.createFacade(
+ "BlueprintContainerRestartService")) {
restartConfigModules(configModules, configFacade);
} catch (ParserConfigurationException | DocumentedException | ValidationException
| ConflictingVersionException e) {
LOG.error("Error restarting config modules", e);
} finally {
- configFacade.close();
bundleContext.ungetService(configFacadeFactoryRef);
}