You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by Ted Kirby <te...@gmail.com> on 2007/03/01 22:25:41 UTC

Re: [jira] Updated: (GERONIMO-2735) Add property substitution capability in the config.xml and plan files

On 2/20/07, David Jencks <da...@yahoo.com> wrote:
> Before I run ahead and apply this I'd like to make sure this is the
> approach we all agree on.
>
> I think there are 2 choices for how to do this:
>
> 1. as done in the patch, where the config.xml has explicit
> substitutions possibly within other text and the substitution
> property names have no connection with the attribute names they are in.

I like this approach in that, as implied by the example, variables can
be named, and applied across multiple modules.

> 2. supplying complete attribute values for arbitrary gbeans whether
> or not those gbeans are mentioned in the config.xml.   This would
> mean the properties file would have something like
>
> module/gbean/attributeName=attributeValue

I am sure I am not fully grasping the intention and implications here,
but nonetheless :), here are my comments:

1. I think this loses the notion of a parameter name and a
substitution value, as in the examples above.

2. What is interesting here is changing values that are not in
config.xml.  On the one hand, this can be an easy way to change
values.  On the other, config.xml serves a a single point of reference
for attribute values, in particular listing those that are mutable
there.  This notion breaks that tradition, and offers another file to
find to see where and what values are set, as well as allowing any
value to be set.  Adding any properties file adds another place to
look, which is what the first option does, too.

Would you want to consider combining the two by doing both?  Two
separate files could be used, or a / in the attribute name could
denote this new second semantics.  Such a combination would allow for
substitutions of the type in option 1.

> I can see advantages to both.
>
> thanks
> david jencks
>
> On Jan 25, 2007, at 2:59 PM, Ted Kirby (JIRA) wrote:
>
> >
> >      [ https://issues.apache.org/jira/browse/GERONIMO-2735?
> > page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
> >
> > Ted Kirby updated GERONIMO-2735:
> > --------------------------------
> >
> >     Attachment: JIRA2735.2.0.patch
> >
> > Here is a patch for ag 2.0, based on v499398 code.
> >
> >> 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, JIRA2735.2.0.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:
> >> ...
> >> <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.
> >
>
>