You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jd...@apache.org on 2008/06/01 09:10:48 UTC

svn commit: r662156 - /geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/application/DefaultApplicationManager.java

Author: jdillon
Date: Sun Jun  1 00:10:48 2008
New Revision: 662156

URL: http://svn.apache.org/viewvc?rev=662156&view=rev
Log:
Add settings context to application model interpolation

Modified:
    geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/application/DefaultApplicationManager.java

Modified: geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/application/DefaultApplicationManager.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/application/DefaultApplicationManager.java?rev=662156&r1=662155&r2=662156&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/application/DefaultApplicationManager.java (original)
+++ geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/application/DefaultApplicationManager.java Sun Jun  1 00:10:48 2008
@@ -20,6 +20,7 @@
 package org.apache.geronimo.gshell.application;
 
 import org.apache.geronimo.gshell.GShell;
+import org.apache.geronimo.gshell.settings.SettingsManager;
 import org.apache.geronimo.gshell.artifact.ArtifactManager;
 import org.apache.geronimo.gshell.io.IO;
 import org.apache.geronimo.gshell.model.application.Application;
@@ -28,6 +29,7 @@
 import org.apache.geronimo.gshell.model.common.RemoteRepository;
 import org.apache.geronimo.gshell.model.interpolate.Interpolator;
 import org.apache.geronimo.gshell.model.interpolate.InterpolatorSupport;
+import org.apache.geronimo.gshell.model.settings.Settings;
 import org.apache.geronimo.gshell.plexus.GShellPlexusContainer;
 import org.apache.geronimo.gshell.plugin.CommandCollector;
 import org.apache.geronimo.gshell.plugin.CommandDiscoverer;
@@ -76,6 +78,9 @@
     @Requirement
     private ArtifactManager artifactManager;
 
+    @Requirement
+    private SettingsManager settingsManager;
+
     private GShellPlexusContainer parentContainer;
 
     private GShellPlexusContainer container;
@@ -140,9 +145,17 @@
 
         // Add value sources to resolve muck
         interp.addValueSource(new PropertiesBasedValueSource(System.getProperties()));
+
+        // User settings should override the applications
+        assert settingsManager != null;
+        Settings settings = settingsManager.getSettings();
+        if (settings != null) {
+            interp.addValueSource(new PropertiesBasedValueSource(settings.getProperties()));
+        }
+
+        // Add application settings
         interp.addValueSource(new PropertiesBasedValueSource(app.getProperties()));
-        // TODO: Add settings.properties
-        
+
         app = interp.interpolate(app);
         
         // Update the configuration with the new model