Return-Path: Delivered-To: apmail-geronimo-dev-archive@www.apache.org Received: (qmail 67283 invoked from network); 25 Jan 2007 14:04:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Jan 2007 14:04:14 -0000 Received: (qmail 74592 invoked by uid 500); 25 Jan 2007 14:04:17 -0000 Delivered-To: apmail-geronimo-dev-archive@geronimo.apache.org Received: (qmail 74553 invoked by uid 500); 25 Jan 2007 14:04:17 -0000 Mailing-List: contact dev-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 dev@geronimo.apache.org Received: (qmail 74534 invoked by uid 99); 25 Jan 2007 14:04:16 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Jan 2007 06:04:16 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Jan 2007 06:04:09 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 199EC7142D4 for ; Thu, 25 Jan 2007 06:03:49 -0800 (PST) Message-ID: <3443924.1169733829073.JavaMail.jira@brutus> Date: Thu, 25 Jan 2007 06:03:49 -0800 (PST) From: "Ted Kirby (JIRA)" To: dev@geronimo.apache.org Subject: [jira] Updated: (GERONIMO-2735) Add property substitution capability in the config.xml and plan files In-Reply-To: <851146.1168953207673.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/GERONIMO-2735?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ted Kirby updated GERONIMO-2735: -------------------------------- Attachment: JIRA2735.1.1.1.patch Here is a patch for 1.1.1 based on Rev447393 code. Here is the approach, from dev list discussion: Substitution is performed by the new substituteVariables method of GBeanOverride, which is invoked in setAttribute. Any values with substituted text are saved in a new unsubstitutedAttribute Map. These raw, unsubstituted values are then saved to config.xml by a change in writeXML. Support for a properties file is added in LocalAttributeManager. A propertiesFile attribute is added to this GBean. It works like configFile, relative to GERONIMO_HOME. The default properties file name is var/config/geronimo.properties, set in the j2ee-system module, like config.xml. The substitution value hierarchy, as specified in the new GBeanOverride. getVariableValue method, is: 1. system properties 2. environment variables 3. properties file Nested/indirect variables, such as ${var{$number}}, are not supported, but would make for an interesting enhancement. GBeanOverride.substituteVariables uses a static LocalAttributeManager.getProperty() method to interrogate the properties loaded from the properties file. I think this is a bit of hack, and solicit input on a better approach. I supposed a reference could be passed in through ServerOverride and ConfigurationOverride. I will now port this work to AG20, and post a patch for it subsequently. > Add property substitution capability in the config.xml and plan files > --------------------------------------------------------------------- > > Key: GERONIMO-2735 > URL: https://issues.apache.org/jira/browse/GERONIMO-2735 > Project: Geronimo > Issue Type: New Feature > Security Level: public(Regular issues) > Affects Versions: 1.1.1, 1.1.x, 2.0-M1 > Environment: All > Reporter: Ted Kirby > Priority: Minor > Attachments: JIRA2735.1.1.1.patch > > > Allow property substitution as it works in maven, Spring, and JBoss. > Allow a geronimo.properties type file. In that file, allow something like this: > tomcat.port=9090 > tomcat.listen.ip=10.0.0.7 > In the config.xml, then allow the following: > ... > > > ${tomcat.port} > ${tomcat.listen.ip} > > > The server reads the property file on boot (if one exists). When the config.xml is processed, it substitutes the declared property. > Properties might also come from a GBean. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.