diff options
author | Harald Musum <musum@verizonmedia.com> | 2020-07-16 14:57:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-16 14:57:35 +0200 |
commit | 81656283891fb3a661e866bd6f534e5efeb76cfd (patch) | |
tree | 86817f8b1bf047240c2b0fec5500f8a2bb3553e6 /container-core/src/main/java/com/yahoo/container/core/config/BundleStarter.java | |
parent | b60de76447e83d944dadfda06754690f1cefb727 (diff) | |
parent | 7912a08dd16a5605baaa13f10baeb5efc2e264a0 (diff) |
Merge pull request #13905 from vespa-engine/revert-13902-reapply-Load-platform-bundles-separately
Revert "Reapply load platform bundles separately"
Diffstat (limited to 'container-core/src/main/java/com/yahoo/container/core/config/BundleStarter.java')
-rw-r--r-- | container-core/src/main/java/com/yahoo/container/core/config/BundleStarter.java | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/container-core/src/main/java/com/yahoo/container/core/config/BundleStarter.java b/container-core/src/main/java/com/yahoo/container/core/config/BundleStarter.java deleted file mode 100644 index 4a87c27b990..00000000000 --- a/container-core/src/main/java/com/yahoo/container/core/config/BundleStarter.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.yahoo.container.core.config; - -import org.osgi.framework.Bundle; -import org.osgi.framework.wiring.BundleRevision; - -import java.util.Collection; - -/** - * Utility to start a collection of bundles. - * - * @author gjoranv - */ -public class BundleStarter { - - private BundleStarter() { } - - /** - * Resolves and starts (calls the Bundles BundleActivator) all bundles. Bundle resolution must take place - * after all bundles are installed to ensure that the framework can resolve dependencies between bundles. - */ - static void startBundles(Collection<Bundle> bundles) { - for (var bundle : bundles) { - try { - if ( ! isFragment(bundle)) - bundle.start(); // NOP for already ACTIVE bundles - } catch(Exception e) { - throw new RuntimeException("Could not start bundle '" + bundle.getSymbolicName() + "'", e); - } - } - } - - private static boolean isFragment(Bundle bundle) { - BundleRevision bundleRevision = bundle.adapt(BundleRevision.class); - if (bundleRevision == null) - throw new NullPointerException("Null bundle revision means that bundle has probably been uninstalled: " + - bundle.getSymbolicName() + ":" + bundle.getVersion()); - return (bundleRevision.getTypes() & BundleRevision.TYPE_FRAGMENT) != 0; - } - -} |