From abc2646dad1f24e10ad94e3b0e61080fb6291980 Mon Sep 17 00:00:00 2001 From: gjoranv Date: Sun, 31 Jul 2022 22:52:07 +0200 Subject: minor: rearrange/rename methods --- .../java/com/yahoo/container/di/Container.java | 30 +++++++++++----------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'container-core/src/main/java/com/yahoo/container/di/Container.java') 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 obsoleteBundles) // NOTE: Return value { @@ -122,7 +130,7 @@ public class Container { Collection 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, ConfigInstance> componentsConfigs, - Injector fallbackInjector) { - ComponentGraph componentGraph = createComponentsGraph(componentsConfigs, getComponentsGeneration(), fallbackInjector); + private ComponentGraph createAndConfigureComponentGraph(Map, 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 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, ConfigInstance> configsIncludingBootstrapConfigs, - long generation, Injector fallbackInjector) { + private ComponentGraph createComponentGraph(Map, ConfigInstance> configsIncludingBootstrapConfigs, + long generation, Injector fallbackInjector) { previousConfigGeneration = generation; ComponentGraph graph = new ComponentGraph(generation); -- cgit v1.2.3