Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 20650 invoked from network); 21 Feb 2007 02:15:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Feb 2007 02:15:26 -0000 Received: (qmail 65054 invoked by uid 500); 21 Feb 2007 02:15:34 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 65011 invoked by uid 500); 21 Feb 2007 02:15:34 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 65000 invoked by uid 99); 21 Feb 2007 02:15:34 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Feb 2007 18:15:34 -0800 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; Tue, 20 Feb 2007 18:15:25 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 7250B1A981A; Tue, 20 Feb 2007 18:15:05 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r509865 - in /geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/condition: JexlConditionParser.java OgnlConditionParser.java Date: Wed, 21 Feb 2007 02:15:05 -0000 To: scm@geronimo.apache.org From: jdillon@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070221021505.7250B1A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jdillon Date: Tue Feb 20 18:15:04 2007 New Revision: 509865 URL: http://svn.apache.org/viewvc?view=rev&rev=509865 Log: Make 'props' a real Properties object so that getProperty(String, String) can be used for default values Modified: geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/condition/JexlConditionParser.java geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/condition/OgnlConditionParser.java Modified: geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/condition/JexlConditionParser.java URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/condition/JexlConditionParser.java?view=diff&rev=509865&r1=509864&r2=509865 ============================================================================== --- geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/condition/JexlConditionParser.java (original) +++ geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/condition/JexlConditionParser.java Tue Feb 20 18:15:04 2007 @@ -23,6 +23,7 @@ import org.apache.commons.jexl.JexlContext; import org.apache.commons.jexl.JexlHelper; +import java.util.Properties; import java.util.Map; import java.util.HashMap; import java.util.Collections; @@ -47,10 +48,13 @@ public JexlConditionParser() { // Setup the default vars vars = new HashMap(); - - vars.put("props", Collections.unmodifiableMap(System.getProperties())); + vars.put("java", new JavaVariable()); vars.put("os", new OsVariable()); + + // Install properties (to allow getProperty(x,y) to be used for defaults + // Using nested defaults to avoid modifications to system props in expresssion + vars.put("props", new Properties(System.getProperties())); } /** Modified: geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/condition/OgnlConditionParser.java URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/condition/OgnlConditionParser.java?view=diff&rev=509865&r1=509864&r2=509865 ============================================================================== --- geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/condition/OgnlConditionParser.java (original) +++ geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/condition/OgnlConditionParser.java Tue Feb 20 18:15:04 2007 @@ -17,6 +17,7 @@ package org.apache.geronimo.system.configuration.condition; +import java.util.Properties; import java.util.Map; import java.util.HashMap; import java.util.Collections; @@ -47,10 +48,13 @@ public OgnlConditionParser() { // Setup the default vars vars = new HashMap(); - - vars.put("props", Collections.unmodifiableMap(System.getProperties())); + vars.put("java", new JavaVariable()); vars.put("os", new OsVariable()); + + // Install properties (to allow getProperty(x,y) to be used for defaults + // Using nested defaults to avoid modifications to system props in expresssion + vars.put("props", new Properties(System.getProperties())); } /**