commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig McClanahan <craig...@gmail.com>
Subject Re: chains: refering to another chain in my chain
Date Fri, 01 Apr 2005 19:18:56 GMT
On Apr 1, 2005 9:12 AM, Vinicius Caldeira Carvalho
<vinicius.carvalho@squadra.com.br> wrote:
> Hello there folks...
> Isnt it possible to refer to a chain as a command from another chain?
> let me explain:
> 
> <chain name="doSomething">
>     <command name="foo" className="foo"/>
>     <command name="bar" className="bar"/>
> </chain>
> 
> <chain name="doSomethingElse">
>     <command name="doSomething"/> //inheirts everthing this chain provides
>     <command name="boo" className="boo"/>
> <chain>
> 
> I think this would be a great adition to the api
> 

It doesn't need to be in the API ... there needs to be a command that
looks up and executes other chains.  Oh wait, there already is :-)

    <command className="org.apache.commons.chain.generic.LookupCommand"
        name="doSomething" [ catalog="catalogName" ] [ optional="true" ] />

This uses the catalog and name identifiers to look up some other
defined command and executes it.  The optional parameter lets you say
"if the command doesn't exist, just silently continue instead of
throwing an error."  This is perfect for letting people optionally
customize a chain without having to reconfigure it.

Craig

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message