cziegeler 02/05/28 07:03:18 Modified: src/java/org/apache/cocoon/components/pipeline AbstractProcessingPipeline.java ProcessingPipeline.java src/java/org/apache/cocoon/components/source SitemapSource.java src/java/org/apache/cocoon/components/source/impl SitemapSource.java src/java/org/apache/cocoon/environment ForwardRedirector.java Log: Changed releasing of processing pipelines Revision Changes Path 1.13 +11 -1 xml-cocoon2/src/java/org/apache/cocoon/components/pipeline/AbstractProcessingPipeline.java Index: AbstractProcessingPipeline.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/pipeline/AbstractProcessingPipeline.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- AbstractProcessingPipeline.java 27 May 2002 14:56:28 -0000 1.12 +++ AbstractProcessingPipeline.java 28 May 2002 14:03:18 -0000 1.13 @@ -82,7 +82,7 @@ * * @since @next-version@ * @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a> - * @version CVS $Id: AbstractProcessingPipeline.java,v 1.12 2002/05/27 14:56:28 cziegeler Exp $ + * @version CVS $Id: AbstractProcessingPipeline.java,v 1.13 2002/05/28 14:03:18 cziegeler Exp $ */ public abstract class AbstractProcessingPipeline extends AbstractLogEnabled @@ -160,6 +160,16 @@ */ public void setup(Parameters params) { this.parameters = params; + } + + /** + * Release this component + * If you get an instance not by a component manager but for example + * by a processor, you have to release this component by calling + * this method and NOT by using a component manager! + */ + public void release() { + this.manager.release( this ); } /** 1.8 +9 -1 xml-cocoon2/src/java/org/apache/cocoon/components/pipeline/ProcessingPipeline.java Index: ProcessingPipeline.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/pipeline/ProcessingPipeline.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- ProcessingPipeline.java 27 May 2002 14:56:28 -0000 1.7 +++ ProcessingPipeline.java 28 May 2002 14:03:18 -0000 1.8 @@ -79,7 +79,7 @@ * * @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a> * @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a> - * @version CVS $Id: ProcessingPipeline.java,v 1.7 2002/05/27 14:56:28 cziegeler Exp $ + * @version CVS $Id: ProcessingPipeline.java,v 1.8 2002/05/28 14:03:18 cziegeler Exp $ */ public interface ProcessingPipeline extends Component, Recomposable { @@ -90,6 +90,14 @@ * Setup this component */ void setup(Parameters params); + + /** + * Release this component + * If you get an instance not by a component manager but for example + * by a processor, you have to release this component by calling + * this method and NOT by using a component manager! + */ + void release(); /** * Set the generator that will be used as the initial step in the pipeline. 1.17 +2 -2 xml-cocoon2/src/java/org/apache/cocoon/components/source/SitemapSource.java Index: SitemapSource.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/source/SitemapSource.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- SitemapSource.java 28 May 2002 13:08:12 -0000 1.16 +++ SitemapSource.java 28 May 2002 14:03:18 -0000 1.17 @@ -87,7 +87,7 @@ * * @deprecated by the Avalon Excalibur Source Resolving * @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a> - * @version CVS $Id: SitemapSource.java,v 1.16 2002/05/28 13:08:12 cziegeler Exp $ + * @version CVS $Id: SitemapSource.java,v 1.17 2002/05/28 14:03:18 cziegeler Exp $ */ public final class SitemapSource @@ -338,7 +338,7 @@ } private void reset() { - if (this.processingPipeline != null) this.manager.release(this.processingPipeline); + if (this.processingPipeline != null) this.processingPipeline.release(); this.processingPipeline = null; this.lastModificationDate = 0; this.environment.reset(); 1.10 +2 -2 xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/SitemapSource.java Index: SitemapSource.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/SitemapSource.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- SitemapSource.java 28 May 2002 13:08:12 -0000 1.9 +++ SitemapSource.java 28 May 2002 14:03:18 -0000 1.10 @@ -92,7 +92,7 @@ * Description of a source which is defined by a pipeline. * * @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a> - * @version CVS $Id: SitemapSource.java,v 1.9 2002/05/28 13:08:12 cziegeler Exp $ + * @version CVS $Id: SitemapSource.java,v 1.10 2002/05/28 14:03:18 cziegeler Exp $ */ public final class SitemapSource @@ -368,7 +368,7 @@ } private void reset() { - if (this.processingPipeline != null) this.manager.release(this.processingPipeline); + if (this.processingPipeline != null) this.processingPipeline.release(); this.processingPipeline = null; this.sourceValidity = null; if (this.redirectSource != null) this.environment.release(this.redirectSource); 1.4 +6 -5 xml-cocoon2/src/java/org/apache/cocoon/environment/ForwardRedirector.java Index: ForwardRedirector.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/environment/ForwardRedirector.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- ForwardRedirector.java 27 May 2002 14:02:30 -0000 1.3 +++ ForwardRedirector.java 28 May 2002 14:03:18 -0000 1.4 @@ -54,11 +54,10 @@ import org.apache.avalon.framework.logger.AbstractLoggable; import org.apache.avalon.framework.component.ComponentException; import org.apache.avalon.framework.component.ComponentManager; - -import org.apache.cocoon.environment.wrapper.EnvironmentWrapper; - import org.apache.cocoon.ProcessingException; import org.apache.cocoon.Processor; +import org.apache.cocoon.components.pipeline.ProcessingPipeline; +import org.apache.cocoon.environment.wrapper.EnvironmentWrapper; import java.io.IOException; import java.net.MalformedURLException; @@ -68,7 +67,7 @@ * redirects using the "cocoon:" pseudo-protocol. * * @author <a href="mailto:[EMAIL PROTECTED]">Sylvain Wallez</a> - * @version CVS $Id: ForwardRedirector.java,v 1.3 2002/05/27 14:02:30 cziegeler Exp $ + * @version CVS $Id: ForwardRedirector.java,v 1.4 2002/05/28 14:03:18 cziegeler Exp $ */ public class ForwardRedirector extends AbstractLoggable implements Redirector { @@ -201,7 +200,9 @@ if ( !this.internal ) { processingResult = actualProcessor.process(newEnv); } else { - processingResult = actualProcessor.processInternal(newEnv) != null; + ProcessingPipeline pp = actualProcessor.processInternal(newEnv); + if (pp != null) pp.release(); + processingResult = pp != null; } if (!processingResult) {
---------------------------------------------------------------------- In case of troubles, e-mail: [EMAIL PROTECTED] To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]