private void install()

in src/main/java/org/apache/sling/feature/launcher/impl/launchers/AbstractRunner.java [319:357]


    private void install(final Framework framework, final Map<Integer, List<URL>> bundleMap) throws BundleException {
        final BundleContext bc = framework.getBundleContext();
        int defaultStartLevel = getProperty(bc, "felix.startlevel.bundle", 1);
        for(final Integer startLevel : sortStartLevels(bundleMap.keySet(), defaultStartLevel)) {
            logger.debug("Installing bundles with start level {}", startLevel);

            for(final URL file : bundleMap.get(startLevel)) {
                logger.debug("- {}", file);

                // use reference protocol if possible. This avoids copying the binary to the cache directory
                // of the framework
                String location = "";
                if (file.getProtocol().equals("file")) {
                    location = "reference:";
                }
                location = location.concat(file.toString());

                final Bundle bundle = bc.installBundle(location, null);

                // fragment?
                if ( !isSystemBundleFragment(bundle) && getFragmentHostHeader(bundle) == null ) {
                    if ( startLevel > 0 ) {
                        bundle.adapt(BundleStartLevel.class).setStartLevel(startLevel);
                    }
                    bundle.start();
                }

                if ( this.bundleReporter != null ) {
                    final Map<String, String> params = new HashMap<>();
                    params.put(Constants.BUNDLE_SYMBOLICNAME, bundle.getSymbolicName());
                    params.put(Constants.BUNDLE_VERSION, bundle.getVersion().toString());
                    params.put("Bundle-Id", String.valueOf(bundle.getBundleId()));

                    this.bundleReporter.accept(file, params);
                }
                    
            }
        }
    }