cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject svn commit: r606646 - in /cocoon/trunk/core/cocoon-sitemap: cocoon-sitemap-api/src/main/java/org/apache/cocoon/ cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/ cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components...
Date Mon, 24 Dec 2007 00:47:29 GMT
Author: vgritsenko
Date: Sun Dec 23 16:47:21 2007
New Revision: 606646

URL: http://svn.apache.org/viewvc?rev=606646&view=rev
Log:
Pipelines node does not need manager anymore (only to pass to error handler).
Pipelines node should not touch context manager, it is set by tree processor itself.
Mount node does not do anything with service manager anymore.
Cleanup error handler helper.

Modified:
    cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-api/src/main/java/org/apache/cocoon/Processor.java
    cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/InvokeContext.java
    cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/ErrorHandlerHelper.java
    cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/MountNode.java
    cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelinesNode.java

Modified: cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-api/src/main/java/org/apache/cocoon/Processor.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-api/src/main/java/org/apache/cocoon/Processor.java?rev=606646&r1=606645&r2=606646&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-api/src/main/java/org/apache/cocoon/Processor.java
(original)
+++ cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-api/src/main/java/org/apache/cocoon/Processor.java
Sun Dec 23 16:47:21 2007
@@ -31,22 +31,26 @@
     /** The role of the root processor */
     String ROLE = Processor.class.getName();
 
+    /**
+     *
+     */
     public static class InternalPipelineDescription {
         
-        public InternalPipelineDescription(ProcessingPipeline pp, 
-                                           ServiceSelector selector,
-                                           ServiceManager manager) {
-            this.processingPipeline = pp;
-            this.pipelineSelector = selector;
-            this.pipelineManager = manager;
-        }
         public ProcessingPipeline processingPipeline;
         public ServiceManager pipelineManager;
         public ServiceSelector pipelineSelector;
         public Processor lastProcessor;
         public String prefix;
         public String uri;
-        
+
+        public InternalPipelineDescription(ProcessingPipeline pipeline,
+                                           ServiceSelector selector,
+                                           ServiceManager manager) {
+            this.processingPipeline = pipeline;
+            this.pipelineSelector = selector;
+            this.pipelineManager = manager;
+        }
+
         public void release() {
             if (this.pipelineSelector != null) {
                 this.pipelineSelector.release(this.processingPipeline);

Modified: cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/InvokeContext.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/InvokeContext.java?rev=606646&r1=606645&r2=606646&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/InvokeContext.java
(original)
+++ cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/InvokeContext.java
Sun Dec 23 16:47:21 2007
@@ -114,10 +114,12 @@
     /**
      * Create an <code>InvokeContext</code> based on existing context.
      */
-    public InvokeContext(InvokeContext context) {
+    public InvokeContext(InvokeContext context, ServiceManager manager) throws ServiceException
{
         this.isBuildingPipelineOnly = context.isBuildingPipelineOnly;
         this.redirector = context.redirector;
         this.lastProcessor = context.lastProcessor;
+        service(manager);
+        inform(context.processingPipelineName, context.processingPipelineParameters, context.processingPipelineObjectModel);
     }
 
     /**

Modified: cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/ErrorHandlerHelper.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/ErrorHandlerHelper.java?rev=606646&r1=606645&r2=606646&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/ErrorHandlerHelper.java
(original)
+++ cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/ErrorHandlerHelper.java
Sun Dec 23 16:47:21 2007
@@ -142,23 +142,6 @@
     }
 
     /**
-     * Handle error using specified error handler processing node.
-     */
-    public boolean invokeErrorHandler(ProcessingNode node,
-                                      Exception ex,
-                                      Environment env,
-                                      InvokeContext context)
-    throws Exception {
-        final Processor.InternalPipelineDescription desc = prepareErrorHandler(node, ex,
env, context);
-        if (desc != null) {
-            context.setInternalPipelineDescription(desc);
-            return true;
-        }
-
-        return false;
-    }
-
-    /**
      * Prepare (or execute) error handler using specified error handler
      * processing node.
      *
@@ -181,9 +164,7 @@
             prepare(context, env, ex);
 
             // Create error context
-            InvokeContext errorContext = new InvokeContext(context);
-            errorContext.service(this.manager);
-            errorContext.inform(context.getPipelineType(), context.getPipelineParameters(),
env.getObjectModel());
+            InvokeContext errorContext = new InvokeContext(context, this.manager);
             try {
                 // Process error handling node
                 if (node.invoke(env, errorContext)) {

Modified: cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/MountNode.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/MountNode.java?rev=606646&r1=606645&r2=606646&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/MountNode.java
(original)
+++ cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/MountNode.java
Sun Dec 23 16:47:21 2007
@@ -109,6 +109,7 @@
                     context.setInternalPipelineDescription(pp);
                     return true;
                 }
+
                 return false;
             }
 
@@ -126,11 +127,6 @@
             } else {
                 env.removeAttribute(COCOON_PASS_THROUGH);
             }
-
-            // Turning recomposing as a test, according to:
-            // http://marc.theaimsgroup.com/?t=106802211400005&r=1&w=2
-            // Recompose pipelines which may have been recomposed by subsitemap
-            // context.recompose(this.manager);
         }
     }
 

Modified: cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelinesNode.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelinesNode.java?rev=606646&r1=606645&r2=606646&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelinesNode.java
(original)
+++ cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelinesNode.java
Sun Dec 23 16:47:21 2007
@@ -35,8 +35,6 @@
 public final class PipelinesNode extends SimpleParentProcessingNode
                                  implements Serviceable, Disposable {
 
-    private ServiceManager manager;
-
     private ErrorHandlerHelper errorHandlerHelper;
 
 
@@ -49,11 +47,9 @@
     }
 
     /**
-     * Keep the component manager used everywhere in the tree so that we can
-     * cleanly dispose it.
+     * Pass manager to {@link ErrorHandlerHelper}.
      */
     public void service(ServiceManager manager) throws ServiceException {
-        this.manager = manager;
         this.errorHandlerHelper.service(manager);
     }
 
@@ -78,9 +74,6 @@
         // Perform any common invoke functionality
         super.invoke(env, context);
 
-        // Recompose context (and pipelines) to the local component manager
-        context.service(this.manager);
-
         try {
             // FIXME: Is there any useful information that can be passed as top-level parameters,
             //        such as the URI of the mount point ?
@@ -90,19 +83,14 @@
         } catch (ConnectionResetException e) {
             // Will be reported by CocoonServlet, rethrowing
             throw e;
+
         } catch (Exception ex) {
             // Invoke pipelines handler
             return this.errorHandlerHelper.invokeErrorHandler(ex, env, context);
         }
     }
 
-    /**
-     * Dispose the component manager.
-     */
     public void dispose() {
-        if (this.manager instanceof Disposable) {
-            ((Disposable) this.manager).dispose();
-        }
-        this.manager = null;
+        this.errorHandlerHelper = null;
     }
 }



Mime
View raw message