felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r519010 - /incubator/felix/trunk/main/src/main/java/org/apache/felix/main/Main.java
Date Fri, 16 Mar 2007 15:32:04 GMT
Author: rickhall
Date: Fri Mar 16 08:32:04 2007
New Revision: 519010

URL: http://svn.apache.org/viewvc?view=rev&rev=519010
Log:
Applied patch (FELIX-250) to add support for setting Felix configuration 
properties using system properties when using the standard Main 
launcher.

Modified:
    incubator/felix/trunk/main/src/main/java/org/apache/felix/main/Main.java

Modified: incubator/felix/trunk/main/src/main/java/org/apache/felix/main/Main.java
URL: http://svn.apache.org/viewvc/incubator/felix/trunk/main/src/main/java/org/apache/felix/main/Main.java?view=diff&rev=519010&r1=519009&r2=519010
==============================================================================
--- incubator/felix/trunk/main/src/main/java/org/apache/felix/main/Main.java (original)
+++ incubator/felix/trunk/main/src/main/java/org/apache/felix/main/Main.java Fri Mar 16 08:32:04
2007
@@ -146,6 +146,9 @@
         // Read configuration properties.
         Properties configProps = Main.loadConfigProperties();
 
+        // Copy framework properties from the system properties.
+        Main.copySystemProperties(configProps);
+
         // See if the profile name property was specified.
         String profileName = configProps.getProperty(BundleCache.CACHE_PROFILE_PROP);
 
@@ -417,6 +420,21 @@
         }
 
         return props;
+    }
+
+    public static void copySystemProperties(Properties configProps)
+    {
+        for (Enumeration e = System.getProperties().propertyNames();
+             e.hasMoreElements(); )
+        {
+            String key = (String)e.nextElement();
+            if (key.startsWith("felix.") ||
+                key.equals("org.osgi.framework.system.packages") ||
+                key.equals("org.osgi.framework.bootdelegation"))
+            {
+                configProps.setProperty(key, System.getProperty(key));
+            }
+        }
     }
 
     private static final String DELIM_START = "${";



Mime
View raw message