Skip to content


Improved: Access configurations inside ‘loadContainersFromConfigurati…
Browse files Browse the repository at this point in the history


This avoids passing an extra argument to

git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
mthl committed Jul 13, 2019
1 parent a4fe696 commit 5a7b0e6
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ public synchronized void load(Config config, List<StartupCommand> ofbizCommands)

// Load containers defined in components.
Debug.logInfo("[Startup] Loading containers...", module);
List<ContainerConfig.Configuration> componentContainerConfigs = ComponentConfig.getAllConfigurations();
loadedContainers.addAll(loadContainersFromConfigurations(componentContainerConfigs, config, ofbizCommands));
loadedContainers.addAll(loadContainersFromConfigurations(config, ofbizCommands));

// Start all containers loaded from above steps
Expand All @@ -94,17 +93,15 @@ private static boolean intersects(Collection<?> a, Collection<?> b) {
* Loads the available containers which are matching the configured loaders.
* @param containerConfigs the list of available container configurations
* @param config the configuration defining the loaders to match
* @param ofbizCommands the parsed commands line arguments used by the containers
* @return a list of loaded containers.
* @throws StartupException when a container fails to load.
private static List<Container> loadContainersFromConfigurations(List<ContainerConfig.Configuration> containerConfigs,
Config config, List<StartupCommand> ofbizCommands) throws StartupException {

private static List<Container> loadContainersFromConfigurations(Config config, List<StartupCommand> ofbizCommands)
throws StartupException {
List<Container> loadContainers = new ArrayList<>();
for (ContainerConfig.Configuration containerCfg : containerConfigs) {
for (ContainerConfig.Configuration containerCfg : ComponentConfig.getAllConfigurations()) {
if (intersects(containerCfg.loaders, config.loaders)) {
Debug.logInfo("Loading container: " +, module);
Container tmpContainer = loadContainer(containerCfg, ofbizCommands);
Expand Down

0 comments on commit 5a7b0e6

Please sign in to comment.