On Tue, 23 Nov 2004 11:26:16 -0600, Hubert Rabago <[EMAIL PROTECTED]> wrote:
> How would plugins work with the chain configuration?
> 
> I've written ActionServlet/RequestProcessor extensions and plugins in
> the past.  Often, the reason is to inject custom pre-, actual, or
> post-processing at specific steps.  An example would Tiles, which IIRC
> intercepts the forward processing to see if the destination is a
> configured tile, otherwise lets the default forward processing
> continue.
> 
> It would be nice if plugins can inject chain elements at specific
> points in the chain at startup, programatically.  This way, plugins
> can be programmed to modify specific portions of the chain that it is
> concerned with, without affecting other portions of the chain or
> modifications of other plugins.
> 

You can actually accomplish this kind of thing today (and an example
of it is in the chain-config.xml file for Struts-Chain), but it's a
little indirect.

In your standard processing chain, do something like this:

    <command className="org.apache.commons.chain.generic.LookupCommand
                  catalogName="foo"
                             name="bar"
                        optional="true"/>

What this does, in English, is:
* Look up a command named "bar" in a catalog named "foo".
* If such a command exists, delegate control to it
  (and do all the right stuff about filters if this is a chain)
* If such a command does not exist, silently continue

Therefore, it's very easy for your standard chain to provide extension
points.  If you want to require that the named command exist, set
optional to "false" instead.

> Hubert

Craig

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to