Search in sources :

Example 1 with ConfigSystemService

use of org.opendaylight.controller.config.api.ConfigSystemService in project controller by opendaylight.

the class BlueprintBundleTracker method shutdownAllContainers.

private void shutdownAllContainers() {
    shuttingDown = true;
    restartService.close();
    // Close all CSS modules first.
    ConfigSystemService configSystem = getOSGiService(ConfigSystemService.class);
    if (configSystem != null) {
        configSystem.closeAllConfigModules();
    }
    LOG.info("Shutting down all blueprint containers...");
    Collection<Bundle> containerBundles = new HashSet<>(Arrays.asList(bundleContext.getBundles()));
    while (!containerBundles.isEmpty()) {
        // eligible to be destroyed. We loop until we've destroyed them all.
        for (Bundle bundle : getBundlesToDestroy(containerBundles)) {
            containerBundles.remove(bundle);
            BlueprintContainer container = blueprintExtenderService.getContainer(bundle);
            if (container != null) {
                blueprintExtenderService.destroyContainer(bundle, container);
            }
        }
    }
    LOG.info("Shutdown of blueprint containers complete");
}
Also used : BlueprintContainer(org.osgi.service.blueprint.container.BlueprintContainer) ConfigSystemService(org.opendaylight.controller.config.api.ConfigSystemService) Bundle(org.osgi.framework.Bundle) HashSet(java.util.HashSet)

Aggregations

HashSet (java.util.HashSet)1 ConfigSystemService (org.opendaylight.controller.config.api.ConfigSystemService)1 Bundle (org.osgi.framework.Bundle)1 BlueprintContainer (org.osgi.service.blueprint.container.BlueprintContainer)1