diff options
author | gjoranv <gv@verizonmedia.com> | 2022-08-31 10:41:32 +0200 |
---|---|---|
committer | gjoranv <gv@verizonmedia.com> | 2022-08-31 10:41:32 +0200 |
commit | aa4a00677f2069f89c47f9bfb57251d6b99a6b80 (patch) | |
tree | a95d2421c4a3de83c6bc89d721d62cd96a9e5523 /container-core/src/main/java/com/yahoo | |
parent | 41b311dd2391e6d3d1566378ab120fa14424ed07 (diff) |
Use a better name map of active bundles.
Diffstat (limited to 'container-core/src/main/java/com/yahoo')
-rw-r--r-- | container-core/src/main/java/com/yahoo/container/core/config/ApplicationBundleLoader.java | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/container-core/src/main/java/com/yahoo/container/core/config/ApplicationBundleLoader.java b/container-core/src/main/java/com/yahoo/container/core/config/ApplicationBundleLoader.java index 19c3577d978..c294a7dd3ec 100644 --- a/container-core/src/main/java/com/yahoo/container/core/config/ApplicationBundleLoader.java +++ b/container-core/src/main/java/com/yahoo/container/core/config/ApplicationBundleLoader.java @@ -29,7 +29,7 @@ public class ApplicationBundleLoader { private static final Logger log = Logger.getLogger(ApplicationBundleLoader.class.getName()); // The active bundles for the current application generation. - private final Map<FileReference, Bundle> reference2Bundle = new LinkedHashMap<>(); + private final Map<FileReference, Bundle> activeBundles = new LinkedHashMap<>(); // The bundles that are obsolete from the previous generation, but kept in case the generation is reverted. private Map<FileReference, Bundle> obsoleteBundles = Map.of(); @@ -58,7 +58,7 @@ public class ApplicationBundleLoader { osgi.allowDuplicateBundles(bundlesToUninstall); bundlesFromNewGeneration = installBundles(newFileReferences); - BundleStarter.startBundles(reference2Bundle.values()); + BundleStarter.startBundles(activeBundles.values()); log.info(installedBundlesMessage()); return bundlesToUninstall; @@ -70,8 +70,8 @@ public class ApplicationBundleLoader { * be done by the Deconstructor as they may still be needed by components from the failed gen. */ public synchronized Collection<Bundle> revertToPreviousGeneration() { - reference2Bundle.putAll(obsoleteBundles); - bundlesFromNewGeneration.forEach(reference2Bundle::remove); + activeBundles.putAll(obsoleteBundles); + bundlesFromNewGeneration.forEach(activeBundles::remove); Collection<Bundle> ret = bundlesFromNewGeneration.values(); // For correct operation of the CollisionHook (more specifically its FindHook implementation), the set of @@ -93,10 +93,10 @@ public class ApplicationBundleLoader { * Returns the map of bundles that are not needed by the new application generation. */ private Map<FileReference, Bundle> removeObsoleteBundles(List<FileReference> newReferences) { - Map<FileReference, Bundle> obsoleteReferences = new LinkedHashMap<>(reference2Bundle); + Map<FileReference, Bundle> obsoleteReferences = new LinkedHashMap<>(activeBundles); newReferences.forEach(obsoleteReferences::remove); - obsoleteReferences.forEach(reference2Bundle::remove); + obsoleteReferences.forEach(activeBundles::remove); return obsoleteReferences; } @@ -107,7 +107,7 @@ public class ApplicationBundleLoader { Set<FileReference> bundlesToInstall = new HashSet<>(references); // This is just an optimization, as installing a bundle with the same location id returns the already installed bundle. - bundlesToInstall.removeAll(reference2Bundle.keySet()); + bundlesToInstall.removeAll(activeBundles.keySet()); if (bundlesToInstall.isEmpty()) return Map.of(); @@ -134,7 +134,7 @@ public class ApplicationBundleLoader { if (bundles.size() > 1 && osgi.hasFelixFramework()) { throw new RuntimeException("Bundle '" + bundles.get(0).getSymbolicName() + "' tried to pre-install bundles from disk."); } - reference2Bundle.put(reference, bundles.get(0)); + activeBundles.put(reference, bundles.get(0)); newBundles.put(reference, bundles.get(0)); } catch(Exception e) { @@ -155,7 +155,7 @@ public class ApplicationBundleLoader { // Only for testing List<FileReference> getActiveFileReferences() { - return new ArrayList<>(reference2Bundle.keySet()); + return new ArrayList<>(activeBundles.keySet()); } } |