Return-Path: Delivered-To: apmail-incubator-felix-commits-archive@www.apache.org Received: (qmail 35259 invoked from network); 16 Mar 2007 15:32:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Mar 2007 15:32:25 -0000 Received: (qmail 97877 invoked by uid 500); 16 Mar 2007 15:32:34 -0000 Delivered-To: apmail-incubator-felix-commits-archive@incubator.apache.org Received: (qmail 97853 invoked by uid 500); 16 Mar 2007 15:32:34 -0000 Mailing-List: contact felix-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: felix-dev@incubator.apache.org Delivered-To: mailing list felix-commits@incubator.apache.org Received: (qmail 97840 invoked by uid 99); 16 Mar 2007 15:32:33 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Mar 2007 08:32:33 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Mar 2007 08:32:25 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 14EF41A9838; Fri, 16 Mar 2007 08:32:05 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: felix-commits@incubator.apache.org From: rickhall@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070316153205.14EF41A9838@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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 = "${";