diff options
author | gjoranv <gjoranv@gmail.com> | 2019-11-04 15:52:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-04 15:52:03 +0100 |
commit | 962ab3348d8ab538bc3a37d085e9be134779763a (patch) | |
tree | f53d289b7c46c62ffd59f80e4d633d9ec6d53472 /jdisc_core | |
parent | f42ecef54f3b6d7d8ff7f2db753b452e14709151 (diff) |
Revert "Gjoranv/hidden bundles logging"
Diffstat (limited to 'jdisc_core')
-rw-r--r-- | jdisc_core/src/main/java/com/yahoo/jdisc/core/BundleCollisionHook.java | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/core/BundleCollisionHook.java b/jdisc_core/src/main/java/com/yahoo/jdisc/core/BundleCollisionHook.java index e2167a5cc96..ae1c81195ce 100644 --- a/jdisc_core/src/main/java/com/yahoo/jdisc/core/BundleCollisionHook.java +++ b/jdisc_core/src/main/java/com/yahoo/jdisc/core/BundleCollisionHook.java @@ -8,7 +8,6 @@ import org.osgi.framework.Version; import org.osgi.framework.hooks.bundle.CollisionHook; import org.osgi.framework.hooks.bundle.EventHook; import org.osgi.framework.hooks.bundle.FindHook; -import org.osgi.framework.launch.Framework; import java.util.Collection; import java.util.HashMap; @@ -19,10 +18,9 @@ import java.util.Set; import java.util.logging.Logger; /** - * A bundle {@link CollisionHook} that contains a set of bundles that are allowed to collide with bundles - * that are about to be installed. This class also implements a {@link FindHook} to provide a consistent - * view of bundles such that the two sets of duplicate bundles are invisible to each other. - * In order to clean up when bundles are uninstalled, this is also a bundle {@link EventHook}. + * A bundle {@link CollisionHook} that contains a set of bundles that are allowed to collide with + * bundles that are about to be installed. In order to clean up when bundles are uninstalled, this + * is also a bundle {@link EventHook}. * * Thread safe * @@ -88,6 +86,9 @@ public class BundleCollisionHook implements CollisionHook, EventHook, FindHook { * If the given context represents one of the allowed duplicates, this method filters out all bundles * that are duplicates of the allowed duplicates. Otherwise this method filters out the allowed duplicates, * so they are not visible to other bundles. + * + * NOTE: This hook method is added for a consistent view of the installed bundles, but is not actively + * used by jdisc. The OSGi framework does not use FindHooks when calculating bundle wiring. */ @Override public synchronized void find(BundleContext context, Collection<Bundle> bundles) { @@ -106,7 +107,7 @@ public class BundleCollisionHook implements CollisionHook, EventHook, FindHook { } } } - logHiddenBundles(context, bundlesToHide); + log.info("Hiding bundles from bundle '" + context.getBundle() + "': " + bundlesToHide); bundles.removeAll(bundlesToHide); } @@ -114,18 +115,6 @@ public class BundleCollisionHook implements CollisionHook, EventHook, FindHook { return ! allowedDuplicates.containsKey(bundle) && allowedDuplicates.containsValue(new BsnVersion(bundle)); } - private void logHiddenBundles(BundleContext requestingContext, Set<Bundle> hiddenBundles) { - if (hiddenBundles.isEmpty()) { - log.fine(() -> "No bundles to hide from bundle " + requestingContext.getBundle()); - } else { - if (requestingContext.getBundle() instanceof Framework) { - log.fine(() -> "Requesting bundle is the Framework, so hidden bundles will be visible: " + hiddenBundles); - } else { - log.info("Hiding bundles from bundle '" + requestingContext.getBundle() + "': " + hiddenBundles); - } - } - } - static class BsnVersion { |