You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by ha...@apache.org on 2011/08/04 07:10:59 UTC

svn commit: r1153754 - in /geronimo/server/trunk/framework/modules/geronimo-system: pom.xml src/main/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java

Author: hanhongfang
Date: Thu Aug  4 05:10:58 2011
New Revision: 1153754

URL: http://svn.apache.org/viewvc?rev=1153754&view=rev
Log:
Using Properties class in felix util package to keep the config-substitutions in section as they are defeined. GERONIMO-5310 Better ordering for config-substitutions.properties

Modified:
    geronimo/server/trunk/framework/modules/geronimo-system/pom.xml
    geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java

Modified: geronimo/server/trunk/framework/modules/geronimo-system/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-system/pom.xml?rev=1153754&r1=1153753&r2=1153754&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/pom.xml (original)
+++ geronimo/server/trunk/framework/modules/geronimo-system/pom.xml Thu Aug  4 05:10:58 2011
@@ -185,6 +185,7 @@
                 <artifactId>maven-bundle-plugin</artifactId>
                 <configuration>
                     <instructions>
+                        <Embed-Dependency>org.apache.felix.bundlerepository;inline=org/apache/felix/utils/properties/*.class</Embed-Dependency>
                         <!--<_versionpolicy>[$(version;==;$(@)),$(version;+;$(@)))</_versionpolicy>-->
                         <Import-Package>javax.security.auth,
                         javax.security.auth.callback,

Modified: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java?rev=1153754&r1=1153753&r2=1153754&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java Thu Aug  4 05:10:58 2011
@@ -32,7 +32,6 @@ import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
-import java.util.Properties;
 import java.util.Timer;
 import java.util.TimerTask;
 
@@ -66,6 +65,7 @@ import org.apache.geronimo.system.plugin
 import org.apache.geronimo.system.serverinfo.ServerInfo;
 import org.xml.sax.SAXException;
 import org.osgi.framework.Bundle;
+import org.apache.felix.utils.properties.Properties;
 
 /**
  * Stores managed attributes in an XML file on the local filesystem.
@@ -257,8 +257,11 @@ public class LocalAttributeManager imple
         return expressionParser.parse(in);
     }
 
-    public void addConfigSubstitutions(Properties properties) {
-        localConfigSubstitutions.putAll(properties);
+    public void addConfigSubstitutions(java.util.Properties properties) {
+        for (Object key : properties.keySet()) {
+            String keyStr = (String) key;
+            localConfigSubstitutions.put(keyStr, properties.getProperty(keyStr));
+        }        
         Map<String, Object> configSubstutions = loadAllConfigSubstitutions(localConfigSubstitutions, prefix);
         storeConfigSubstitutions(configSubstitutionsFile, localConfigSubstitutions);
         expressionParser.setVariables(configSubstutions);
@@ -675,7 +678,7 @@ public class LocalAttributeManager imple
                 FileOutputStream out = new FileOutputStream(configSubstitutionsFile);
                 try {
                     out.write(INSTRUCTION);                    
-                    properties.store(out, null);
+                    properties.save(out);
                 } finally {
                     out.close();
                 }