geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ted Kirby (JIRA)" <>
Subject [jira] Updated: (GERONIMO-2735) Add property substitution capability in the config.xml and plan files
Date Thu, 25 Jan 2007 14:03:49 GMT


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/, set in the j2ee-system module, like

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:
>             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 type file.  In that file, allow something like this:
> tomcat.port=9090
> tomcat.listen.ip=
> In the config.xml, then allow the following:
> ...
> <module name="...">
>     <gbean name="TomcatConnector">
>         <attribute name="port">${tomcat.port}</attribute>
>         <attribute name="host">${tomcat.listen.ip}</attribute>
>    </gbean>
> </module>
> 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.

View raw message