Return-Path: Delivered-To: apmail-geronimo-dev-archive@www.apache.org Received: (qmail 61851 invoked from network); 5 Mar 2007 15:46:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Mar 2007 15:46:39 -0000 Received: (qmail 10155 invoked by uid 500); 5 Mar 2007 15:46:44 -0000 Delivered-To: apmail-geronimo-dev-archive@geronimo.apache.org Received: (qmail 10117 invoked by uid 500); 5 Mar 2007 15:46:44 -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 10106 invoked by uid 99); 5 Mar 2007 15:46:44 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Mar 2007 07:46:44 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of ted.kirby@gmail.com designates 64.233.184.237 as permitted sender) Received: from [64.233.184.237] (HELO wr-out-0506.google.com) (64.233.184.237) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Mar 2007 07:46:33 -0800 Received: by wr-out-0506.google.com with SMTP id 36so1750581wra for ; Mon, 05 Mar 2007 07:46:12 -0800 (PST) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=oFUcGsZemnjLxjfk5ks7mfHPZ/OuJfz1RxGcNK7ldKCEqmcj7xaasTY2FacsAnYt/9ry8T8RVjl4VHPbWDi3Cz9CHp2ZZi+TSJx5DuitiVLlpJfjKt8hDUPGDgpH2UMqpMsr10kHy6Bjb6nVR8h/5yRQ3SQS7ydvs8RDM9oWuog= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=N7qH6+dAeULMbbTmdBhZuidnmkfoKbcdLA0AqGl0yhskKdA5ZVkvNcXDizx8Hiyz7DyagR3s1k02QbMaNA5DBDrKdaySXJ6JMqcHgo8ofkcA3e4DB+IyhmST4KJVm+ulno0rgXydiRpWoEWGsZt3z2wmS1LkmsaOZMgo26d/ffU= Received: by 10.114.151.13 with SMTP id y13mr1287092wad.1173109571535; Mon, 05 Mar 2007 07:46:11 -0800 (PST) Received: by 10.114.77.8 with HTTP; Mon, 5 Mar 2007 07:46:11 -0800 (PST) Message-ID: <3da992810703050746k61ff6ae5i30f4e2c1d89dbe1d@mail.gmail.com> Date: Mon, 5 Mar 2007 10:46:11 -0500 From: "Ted Kirby" To: dev@geronimo.apache.org Subject: Re: Property substitution in config.xml implemented In-Reply-To: <76C1E021-9945-4E88-B3E7-625A5F7CD781@apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <76C1E021-9945-4E88-B3E7-625A5F7CD781@apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Brilliant! Yeah, this is a great extension to my paltry start... :) Thanks, Ted Kirby On 3/3/07, David Jencks wrote: > Following Ted Kirby's idea of property substitution in config.xml > files (GERONIMO-2735) I applied and modified his patch. Jason Dillon > had a jexl expression evaluator lying around so I replace the > evaluation code in the patch with the jexl stuff, so now you can use > expressions in your substitutions. > > The substitutions are in a new file, default location var/config/ > config-substitutions.properties. This is used to evaluate > expressions in config.xml. I implemented a small example in geronimo- > jetty6-jee5 for the jetty connectors, using > > hostName > httpPort > httpsPort > portOffset. > > You can override a value in the properties file with an environment > variable or a system property. Therefore, to start a server on a > different set of jetty connector ports, you can say: > > java -DportOffset=1 -jar bin/server.jar --long I particularly like how this elegantly addresses the multiple server instances port numbering issues, to make it very easy to define multiple server instances. Just give a server name and port offset, and you are set. Now, if I can only locate where port 4200 is set... :) (See my user posting here http://article.gmane.org/gmane.comp.java.geronimo.user/5966 .) Ted Kirby > If this generally seems like a good idea and no one has a better idea > I'll go through the config.xmls and use substitutions more > systematically in a few days. > > One question I have is whether it's really a good idea to use > environment variables for substitutions. I really don't know and > would appreciate more informed opinions. > > Also, you can specify an alternate properties file on the command > line with > > java -Dorg.apache.geronimo.config.substitutions.file=where.ever.you.want > > Many thanks to ted for coming up with the original patch and pushing > for it. > > thanks > david jencks > >