I like the form Aaron suggested better.

<gbean name="TomcatEngine">
  <reference name="TomcatValveChain" />
  <attribute name="someAttribute" />
</gbean>

Both the attribute and value would be reset. The only drawback is that there would be no way to create an empty string, but I don't think that is possible today anyway. Also, I don't think there is anything that needs it.

-dain

On Feb 24, 2006, at 2:56 PM, Aaron Mulder wrote:

What's wrong with just listing the attribute or reference with no
content but without the new "empty=true"?  As in:

<gbean name="TomcatEngine">
  <reference name="TomcatValveChain" />
</gbean>

Thanks,
    Aaron

On 2/24/06, Jeff Genender <[EMAIL PROTECTED]> wrote:
The config.xml allows us to declare new GBeans and override references
and attributes of already existing Gbeans. But there is a missing
configuration item here, which is the ability to *remove* a reference or attribute value from the configuration. Currently there is no way to do
this.

Matt Hogstrom and I ran into this when trying to remove a logging
reference in one of the GBeans.

An example of this is the TomcatValveChain on the TomcatEngine. As it stands, our default implementation installs an AccessLogValve into the
TomcatValveChain reference.  We wanted to shut off logging to test
different performance numbers and found that there was no way to "clear" or remove a reference that was set in the car plan via the config.xml,
without rebuilding the car from the source.

On further discussion with David J and Dain, we came up with a new xml
attribute to place on refs and attribute tags. You would use:

empty="true"

Example: You want to remove the access logger to improve web container
performance, you would declare the following in the config.xml, which
would remove the TomcatValveChain from the TomcatEngine:

...
<configuration name="geronimo/tomcat/1.1-SNAPSHOT/car">
    ...
    <gbean name="FirstValve" load="false"/>

    <gbean name="TomcatEngine">
        <reference name="TomcatValveChain" empty="true"/>
    </gbean>
    ...
</configuration>
...

You would do the same for attributes that needed to be removed.

I have this all coded up and ready to check in, but wanted to get any
feedback or issues before I went ahead and did it.

Comments?

Jeff


Reply via email to