onami-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1509729 - /onami/sandbox/console/src/main/java/org/apache/onami/console/commands/ConsoleRunner.java
Date Fri, 02 Aug 2013 14:50:56 GMT
Author: simonetripodi
Date: Fri Aug  2 14:50:56 2013
New Revision: 1509729

URL: http://svn.apache.org/r1509729
Log:
onami-spi modules lazy loading makes Guice not expand variables, so let's load 'em all first
and then use onami-configuration to resolve all variables

Modified:
    onami/sandbox/console/src/main/java/org/apache/onami/console/commands/ConsoleRunner.java

Modified: onami/sandbox/console/src/main/java/org/apache/onami/console/commands/ConsoleRunner.java
URL: http://svn.apache.org/viewvc/onami/sandbox/console/src/main/java/org/apache/onami/console/commands/ConsoleRunner.java?rev=1509729&r1=1509728&r2=1509729&view=diff
==============================================================================
--- onami/sandbox/console/src/main/java/org/apache/onami/console/commands/ConsoleRunner.java
(original)
+++ onami/sandbox/console/src/main/java/org/apache/onami/console/commands/ConsoleRunner.java
Fri Aug  2 14:50:56 2013
@@ -45,6 +45,7 @@ import org.apache.onami.console.modules.
 
 import com.google.inject.Inject;
 import com.google.inject.Injector;
+import com.google.inject.Module;
 
 @Command( name = "run" )
 public final class ConsoleRunner
@@ -84,7 +85,16 @@ public final class ConsoleRunner
 
         // setup the injector by discovering modules and commands automatically
 
-        Injector injector = createInjector( expandVariables( loadModules( artifactsClassLoader
) ),
+        // NOTE: lazy loading makes Guice not expand variables, so let's load 'em all first
+        Iterable<? extends Module> modules = loadModules( artifactsClassLoader );
+        List<Module> modulesList = new LinkedList<Module>();
+        for ( Module module : modules )
+        {
+            modulesList.add( module );
+        }
+
+        Injector injector = createInjector( expandVariables( modulesList ),
+                                            // ClassLoaderModule does not need to be expanded
                                             new ClassLoaderModule( artifactsClassLoader )
);
 
         // retrieve components needed to run the console



Mime
View raw message