aboutsummaryrefslogtreecommitdiffstats
path: root/container-core/src/main/java/com/yahoo/container/di/Container.java
diff options
context:
space:
mode:
authorgjoranv <gv@verizonmedia.com>2022-07-31 22:52:07 +0200
committergjoranv <gv@verizonmedia.com>2022-08-25 12:08:14 +0200
commitabc2646dad1f24e10ad94e3b0e61080fb6291980 (patch)
tree091cb82e61c50185c8a2b667a9176d99eff2dd91 /container-core/src/main/java/com/yahoo/container/di/Container.java
parent521a6fe075a4eb895703cacd1787ccd1b4d7499f (diff)
minor: rearrange/rename methods
Diffstat (limited to 'container-core/src/main/java/com/yahoo/container/di/Container.java')
-rw-r--r--container-core/src/main/java/com/yahoo/container/di/Container.java30
1 files changed, 15 insertions, 15 deletions
diff --git a/container-core/src/main/java/com/yahoo/container/di/Container.java b/container-core/src/main/java/com/yahoo/container/di/Container.java
index 1baf217da6b..dbf2ba4a9a8 100644
--- a/container-core/src/main/java/com/yahoo/container/di/Container.java
+++ b/container-core/src/main/java/com/yahoo/container/di/Container.java
@@ -94,6 +94,14 @@ public class Container {
}
}
+ private void constructComponents(ComponentGraph graph) {
+ graph.nodes().forEach(n -> {
+ if (Thread.interrupted())
+ throw new UncheckedInterruptedException("Interrupted while constructing component graph", true);
+ n.constructInstance();
+ });
+ }
+
private ComponentGraph waitForNewConfigGenAndCreateGraph(
ComponentGraph graph, Injector fallbackInjector, boolean isInitializing, Collection<Bundle> obsoleteBundles) // NOTE: Return value
{
@@ -122,7 +130,7 @@ public class Container {
Collection<Bundle> bundlesToRemove = installApplicationBundles(snapshot.configs());
obsoleteBundles.addAll(bundlesToRemove);
- graph = createComponentsGraph(snapshot.configs(), getBootstrapGeneration(), fallbackInjector);
+ graph = createComponentGraph(snapshot.configs(), getBootstrapGeneration(), fallbackInjector);
// Continues loop
@@ -131,7 +139,7 @@ public class Container {
}
}
log.log(FINE, () -> "Got components configs,\n" + configGenerationsString());
- return createAndConfigureComponentsGraph(snapshot.configs(), fallbackInjector);
+ return createAndConfigureComponentGraph(snapshot.configs(), fallbackInjector);
}
private long getBootstrapGeneration() {
@@ -153,21 +161,13 @@ public class Container {
throw new RuntimeException("Platform bundles are not allowed to change!\nOld: " + platformBundles + "\nNew: " + checkPlatformBundles);
}
- private ComponentGraph createAndConfigureComponentsGraph(Map<ConfigKey<? extends ConfigInstance>, ConfigInstance> componentsConfigs,
- Injector fallbackInjector) {
- ComponentGraph componentGraph = createComponentsGraph(componentsConfigs, getComponentsGeneration(), fallbackInjector);
+ private ComponentGraph createAndConfigureComponentGraph(Map<ConfigKey<? extends ConfigInstance>, ConfigInstance> componentsConfigs,
+ Injector fallbackInjector) {
+ ComponentGraph componentGraph = createComponentGraph(componentsConfigs, getComponentsGeneration(), fallbackInjector);
componentGraph.setAvailableConfigs(componentsConfigs);
return componentGraph;
}
- private void constructComponents(ComponentGraph graph) {
- graph.nodes().forEach(n -> {
- if (Thread.interrupted())
- throw new UncheckedInterruptedException("Interrupted while constructing component graph", true);
- n.constructInstance();
- });
- }
-
private void deconstructFailedGraph(ComponentGraph currentGraph, ComponentGraph failedGraph) {
Set<Object> currentComponents = Collections.newSetFromMap(new IdentityHashMap<>(currentGraph.size()));
currentComponents.addAll(currentGraph.allConstructedComponentsAndProviders());
@@ -199,8 +199,8 @@ public class Container {
return osgi.useApplicationBundles(applicationBundlesConfig.bundles());
}
- private ComponentGraph createComponentsGraph(Map<ConfigKey<? extends ConfigInstance>, ConfigInstance> configsIncludingBootstrapConfigs,
- long generation, Injector fallbackInjector) {
+ private ComponentGraph createComponentGraph(Map<ConfigKey<? extends ConfigInstance>, ConfigInstance> configsIncludingBootstrapConfigs,
+ long generation, Injector fallbackInjector) {
previousConfigGeneration = generation;
ComponentGraph graph = new ComponentGraph(generation);