Vadim Gritsenko skrev:
Leszek Gawron wrote:
Joerg Heinicke wrote:
On 10.10.2007 4:45 Uhr, Leszek Gawron wrote:

2. Look at SitemapModelComponent:

void setup(SourceResolver resolver, Map objectModel, String src, Parameters par) throws ProcessingException, SAXException, IOException;
}

It looks like we could drop the source resolver and objectModel. Both can be injected and AFAIU both are properly scoped with some custom scope of ours.

But that's an interface and the method is probably called by the pipeline. You still have to support both Avalon and Spring and need at least a migration path in the pipeline.

Of course not now but that is just a pointer that spring invalidates somehow this interface.

May be a bit of RT, but would it be possible to replace this interface with pipeline scope and injection of parameters. Resolver and object model already can be injected, IIUC. Same could be extended to source and parameters. WDYT?

Yes. What is needed is a "sitemap component" scope. During sitemap execution the current source and parameters are pushed on a (thread local) stack before calling methods on the sitemap components and pulled afterwards. Then there are proxied sitemap component scoped factory beans for the current parameters and source that just access from the stack.

As all context change might be expensive we might restrict the implementation of sitemap component scope so that it only works for prototype scoped sitemap components and during their creation.

A somewhat different approach would be to do a little bit like Struts 2 and have a special bean post processor that use the above mentioned stack and auto wire parameters, source and various objects in the object model.

Some earlier thoughts about this topic can be found here http://marc.info/?l=xml-cocoon-dev&m=118578691800176&w=2 and here http://marc.info/?l=xml-cocoon-dev&m=118755548212158&w=2.

/Daniel

Reply via email to