public void bundleChanged()

in src/main/java/org/apache/sling/launchpad/startupmanager/StartupListenerTracker.java [121:140]


    public void bundleChanged(BundleEvent event) {
        if (event.getType() == BundleEvent.STARTED && !frameworkStarted) {
            Bundle[] allBundles = bundleContext.getBundles();
            int total = allBundles.length;
            int started = 0;
            for (Bundle b : allBundles) {
                if (b.getState() == Bundle.ACTIVE) {
                    started++;
                }
            }
            float ratio = 0;
            if (total > 0) {
                ratio = (float) started / total;
            }
            log.info("Startup progress: {}% (bundles {}/{})", new Object[] {(int) (ratio * 100), started, total});
            for (StartupListener listener : tracker.getServices(new StartupListener[0])) {
                listener.startupProgress(ratio);
            }
        }
    }