Author: mthl
Date: Sat Jul 13 21:40:57 2019
New Revision: 1863022
URL:
http://svn.apache.org/viewvc?rev=1863022&view=revLog:
Improved: Access configurations inside ‘loadContainersFromConfigurations’
(OFBIZ-11100)
This avoids passing an extra argument to
‘loadContainersFromConfigurations’.
Modified:
ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/container/ContainerLoader.java
Modified: ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/container/ContainerLoader.java
URL:
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/container/ContainerLoader.java?rev=1863022&r1=1863021&r2=1863022&view=diff==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/container/ContainerLoader.java (original)
+++ ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/container/ContainerLoader.java Sat Jul 13 21:40:57 2019
@@ -72,8 +72,7 @@ public class ContainerLoader {
// 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
startLoadedContainers();
@@ -94,17 +93,15 @@ public class ContainerLoader {
/**
* 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: " + containerCfg.name, module);
Container tmpContainer = loadContainer(containerCfg, ofbizCommands);