geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r662156 - /geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/application/DefaultApplicationManager.java
Date Sun, 01 Jun 2008 07:10:48 GMT
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



Mime
View raw message