private void registerBundle()

in src/main/java/org/apache/sling/extensions/leakdetector/internal/LeakDetector.java [113:130]


    private void registerBundle(Bundle bundle) {
        ClassLoader cl = getClassloader(bundle);
        //cl would be null for Fragment bundle
        if (cl != null) {
            BundleReference ref = new BundleReference(bundle, cl);
            refs.add(ref);

            //Note that a bundle can be started multiple times
            //for e.g. when refreshed So we need to account for that also
            BundleInfo bi = bundleInfos.get(bundle.getBundleId());
            if (bi == null) {
                bi = new BundleInfo(bundle);
                bundleInfos.put(bundle.getBundleId(), bi);
            }
            bi.incrementUsageCount(ref);
            log.info("Registered bundle [{}] with Classloader [{}]", bi, ref.classloaderInfo);
        }
    }