cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject svn commit: r157436 - cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/bean/CocoonWrapper.java
Date Mon, 14 Mar 2005 17:13:27 GMT
Author: vgritsenko
Date: Mon Mar 14 09:13:25 2005
New Revision: 157436

URL: http://svn.apache.org/viewcvs?view=rev&rev=157436
Log:
something tells me pipeline.process should be within env.
use finally block.

Modified:
    cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/bean/CocoonWrapper.java

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/bean/CocoonWrapper.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/bean/CocoonWrapper.java?view=diff&r1=157435&r2=157436
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/bean/CocoonWrapper.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/bean/CocoonWrapper.java Mon Mar
14 09:13:25 2005
@@ -110,16 +110,16 @@
         // Create a new hierarchy. This is needed when CocoonBean is called from
         // within a CocoonServlet call, in order not to mix logs
         final Hierarchy hierarchy = new Hierarchy();
-        
+
         final Priority priority = Priority.getPriorityForName(logLevel);
         hierarchy.setDefaultPriority(priority);
-        
+
         // Install a temporary logger so that getDir() can log if needed
         this.log = new LogKitLogger(hierarchy.getLoggerFor(""));
 
         try {
             // First of all, initialize the logging system
-            
+
             // Setup the application context with context-dir and work-dir that
             // can be used in logkit.xconf
             this.context = getDir(this.contextDir, "context");
@@ -502,7 +502,7 @@
      * @param deparameterizedURI a <code>String</code> value of an URI to start
sampling from
      * @param parameters a <code>Map</code> value containing request parameters
      * @param links a <code>Map</code> value
-     * @param stream an <code>OutputStream</code> to write the content to
+     * @param handler an <code>ContentHandler</code> to send the content to
      * @return a <code>String</code> value for the content
      * @exception Exception if an error occurs
      */
@@ -525,9 +525,12 @@
         XMLConsumer consumer = new ContentHandlerWrapper(handler);
         ProcessingPipeline pipeline = cocoon.buildPipeline(env);
         CocoonComponentManager.enterEnvironment(env, cocoon.getComponentManager(), cocoon);
-        pipeline.prepareInternal(env);
-        CocoonComponentManager.leaveEnvironment();
-        pipeline.process(env, consumer);
+        try {
+            pipeline.prepareInternal(env);
+            pipeline.process(env, consumer);
+        } finally {
+            CocoonComponentManager.leaveEnvironment();
+        }
 
         // if we get here, the page was created :-)
         int status = env.getStatus();



Mime
View raw message