On Thu, 2011-08-18 at 11:39 +0200, Thorsten Scherler wrote: > On Tue, 2011-08-16 at 22:45 +0200, Sylvain Wallez wrote: ... > > > > Please read: I suggested to clone them, so that there is no need for > > them nor their components to be thread safe. You create a "master" > > pipeline that is never executed and then deep-clone it every time it > > needs to be processed. > > Actually that sounds very interesting for NonCaching pipes, however the > main problem ATM for me is that I cannot execute a pipeline two times.
In in the end I did the clone approach due to the limitation that I was not able to reuse the same pipe. So I created: public class SummaryPipe extends NonCachingPipeline<StAXPipelineComponent> implements Cloneable{ ... public Object clone() throws CloneNotSupportedException{ ... } The pipe is a pre-setup pipeline wich I then configure via my custom public void setup(Myargs args,...){ //prepare components with args this.addComponent(generator); this.addComponent(transformer); this.addComponent(serializer); this.setup(output); and in my business code I do clone = (SummaryPipe) pipe.clone(); clone.setup(Myargs args,...); clone.execute(); > > If that is a limitation of the pipes or a bug I do not know, but reading > Steven answer makes me think it is a bug. Actually somebody with more knowledge on the pipeline API may comment on this. salu2 -- Thorsten Scherler <thorsten.at.apache.org> codeBusters S.L. - web based systems <consulting, training and solutions> http://www.codebusters.es/