geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <djen...@apache.org>
Subject Property substitution in config.xml implemented
Date Sun, 04 Mar 2007 04:47:30 GMT
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

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


Mime
View raw message