cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r280821 - in /cocoon/trunk/src/java/org/apache/cocoon/components/treeprocessor: InvokeContext.java sitemap/PipelineNode.java
Date Wed, 14 Sep 2005 11:03:50 GMT
Author: cziegeler
Date: Wed Sep 14 04:03:46 2005
New Revision: 280821

URL: http://svn.apache.org/viewcvs?rev=280821&view=rev
Log:
Create pipeline only if it is used

Modified:
    cocoon/trunk/src/java/org/apache/cocoon/components/treeprocessor/InvokeContext.java
    cocoon/trunk/src/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelineNode.java

Modified: cocoon/trunk/src/java/org/apache/cocoon/components/treeprocessor/InvokeContext.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/components/treeprocessor/InvokeContext.java?rev=280821&r1=280820&r2=280821&view=diff
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/components/treeprocessor/InvokeContext.java (original)
+++ cocoon/trunk/src/java/org/apache/cocoon/components/treeprocessor/InvokeContext.java Wed
Sep 14 04:03:46 2005
@@ -32,6 +32,7 @@
 import org.apache.cocoon.components.pipeline.ProcessingPipeline;
 import org.apache.cocoon.environment.Environment;
 import org.apache.cocoon.environment.Redirector;
+import org.apache.cocoon.sitemap.SitemapErrorHandler;
 
 /**
  * The invocation context of <code>ProcessingNode</code>s.
@@ -87,6 +88,9 @@
     /** The internal pipeline description */
     protected Processor.InternalPipelineDescription internalPipelineDescription;
 
+    /** The error handler for the pipeline. */
+    protected SitemapErrorHandler errorHandler;
+
     /** The last processor */
     protected Processor lastProcessor;
 
@@ -128,14 +132,6 @@
     public void inform(String     pipelineName,
                        Parameters parameters,
                        Map        objectModel) {
-        // FIXME quick fix to get pipeline section running again
-        if ( this.processingPipeline != null ) {
-            this.pipelineSelector.release(this.processingPipeline);
-            this.pipelinesManager.release(this.pipelineSelector);
-            this.pipelineSelector = null;
-            this.pipelinesManager = null;
-            this.processingPipeline = null;
-        }
         this.processingPipelineName = pipelineName;
         this.processingPipelineParameters = parameters;
         this.processingPipelineObjectModel = objectModel;
@@ -163,6 +159,7 @@
             this.processingPipeline.setProcessorManager(this.currentManager);
 
             this.processingPipeline.setup(this.processingPipelineParameters);
+            this.processingPipeline.setErrorHandler(this.errorHandler);
         }
         return this.processingPipeline;
     }
@@ -323,5 +320,12 @@
             this.processingPipelineParameters = null;
             this.processingPipelineObjectModel = null;
         }
+    }
+
+    /**
+     * Set the error handler for the pipeline.
+     */
+    public void setErrorHandler(SitemapErrorHandler handler) {
+        this.errorHandler = handler;
     }
 }

Modified: cocoon/trunk/src/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelineNode.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelineNode.java?rev=280821&r1=280820&r2=280821&view=diff
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelineNode.java
(original)
+++ cocoon/trunk/src/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelineNode.java
Wed Sep 14 04:03:46 2005
@@ -145,11 +145,11 @@
         try {
             if (this.errorHandlerHelper.isInternal()) {
                 // Set internal error handler in the pipeline
-                context.getProcessingPipeline().setErrorHandler(
+                context.setErrorHandler(
                         new SitemapErrorHandler(this.errorHandlerHelper, env, context));
             } else {
                 // Reset internal error handler (previous pipeline might had set it) 
-                context.getProcessingPipeline().setErrorHandler(null);
+                context.setErrorHandler(null);
             }
 
             if (invokeNodes(children, env, context)) {



Mime
View raw message