diff options
author | gjoranv <gv@verizonmedia.com> | 2019-10-26 02:04:18 +0200 |
---|---|---|
committer | gjoranv <gv@verizonmedia.com> | 2019-10-28 14:09:03 +0100 |
commit | 38ab0914bb97438ea8ddbe03089155192154580c (patch) | |
tree | 37036f4c68f44b2ccf0255c7a5818e56b7d16fcc /standalone-container/src | |
parent | ea149387f4e94edefdd8a4677075a1531e2357d0 (diff) |
Support safe component deconstruction in jdisc container.
- Add allowDuplicates to all Osgi classes
- Uninstall bundles in Deconstructor
- We no longer refresh bundles because we uninstall old bundles at
a later point than the new bundles are installed. Hence, the
user must version app bundles that are dependencies used by
other app bundles.
Diffstat (limited to 'standalone-container/src')
2 files changed, 18 insertions, 1 deletions
diff --git a/standalone-container/src/main/java/com/yahoo/application/container/impl/ClassLoaderOsgiFramework.java b/standalone-container/src/main/java/com/yahoo/application/container/impl/ClassLoaderOsgiFramework.java index 08a70db7562..0d5b4c85264 100644 --- a/standalone-container/src/main/java/com/yahoo/application/container/impl/ClassLoaderOsgiFramework.java +++ b/standalone-container/src/main/java/com/yahoo/application/container/impl/ClassLoaderOsgiFramework.java @@ -63,7 +63,7 @@ public final class ClassLoaderOsgiFramework implements OsgiFramework { @Override public List<Bundle> installBundle(String bundleLocation) { - if (bundleLocation != null && bundleLocation.isEmpty() == false) { + if (bundleLocation != null && ! bundleLocation.isEmpty()) { try { URL url = new URL(bundleLocation); bundleLocations.add(url); @@ -106,6 +106,14 @@ public final class ClassLoaderOsgiFramework implements OsgiFramework { } @Override + public List<Bundle> getBundles(Bundle requestingBundle) { + return bundleList; + } + + @Override + public void allowDuplicateBundles(Collection<Bundle> bundles) { } + + @Override public void start() { } diff --git a/standalone-container/src/main/java/com/yahoo/container/standalone/StandaloneContainerActivator.java b/standalone-container/src/main/java/com/yahoo/container/standalone/StandaloneContainerActivator.java index 04c3396c95c..cfd5f753c4f 100644 --- a/standalone-container/src/main/java/com/yahoo/container/standalone/StandaloneContainerActivator.java +++ b/standalone-container/src/main/java/com/yahoo/container/standalone/StandaloneContainerActivator.java @@ -24,6 +24,7 @@ import java.net.InetSocketAddress; import java.nio.channels.ServerSocketChannel; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collection; import java.util.Collections; import java.util.Hashtable; import java.util.List; @@ -142,6 +143,14 @@ public class StandaloneContainerActivator implements BundleActivator { } @Override + public List<Bundle> getBundles(Bundle requestingBundle) { + return Collections.emptyList(); + } + + @Override + public void allowDuplicateBundles(Collection<Bundle> bundles) { } + + @Override public void start() { } |