cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylvain.wal...@anyware-tech.com>
Subject Re: cvs commit: cocoon-2.1/src/java/org/apache/cocoon/environment ForwardRedirector.java
Date Mon, 10 Mar 2003 15:05:32 GMT
Just some thoughts : shouldn't it be the job of the Processor to call 
startProcessing/endProcessing instead of having it duplicated in every 
place where Processor.process() is called ?

Sylvain

cziegeler@apache.org wrote:

>cziegeler    2003/03/10 06:23:00
>
>  Modified:    src/java/org/apache/cocoon/environment
>                        ForwardRedirector.java
>  Log:
>  Perhaps fixing bug 17673
>  
>  Revision  Changes    Path
>  1.2       +15 -7     cocoon-2.1/src/java/org/apache/cocoon/environment/ForwardRedirector.java
>  
>  Index: ForwardRedirector.java
>  ===================================================================
>  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/environment/ForwardRedirector.java,v
>  retrieving revision 1.1
>  retrieving revision 1.2
>  diff -u -r1.1 -r1.2
>  --- ForwardRedirector.java	9 Mar 2003 00:09:28 -0000	1.1
>  +++ ForwardRedirector.java	10 Mar 2003 14:23:00 -0000	1.2
>  @@ -56,6 +56,7 @@
>   import org.apache.avalon.framework.component.ComponentManager;
>   import org.apache.cocoon.ProcessingException;
>   import org.apache.cocoon.Processor;
>  +import org.apache.cocoon.components.CocoonComponentManager;
>   import org.apache.cocoon.components.pipeline.ProcessingPipeline;
>   import org.apache.cocoon.environment.wrapper.EnvironmentWrapper;
>   
>  @@ -197,13 +198,20 @@
>               boolean processingResult;
>   
>               // FIXME - What to do here?
>  -            if ( !this.internal ) {
>  -                processingResult = actualProcessor.process(newEnv);
>  -            } else {
>  -                ProcessingPipeline pp = actualProcessor.processInternal(newEnv);
>  -                if (pp != null) pp.release();
>  -                processingResult = pp != null;
>  +            Object processKey = CocoonComponentManager.startProcessing(newEnv);
>  +            try {
>  +                
>  +                if ( !this.internal ) {
>  +                    processingResult = actualProcessor.process(newEnv);
>  +                } else {
>  +                    ProcessingPipeline pp = actualProcessor.processInternal(newEnv);
>  +                    if (pp != null) pp.release();
>  +                    processingResult = pp != null;
>  +                }
>  +            } finally {
>  +                CocoonComponentManager.endProcessing(newEnv, processKey);
>               }
>  +
>   
>               if (!processingResult) {
>                   throw new ProcessingException("Couldn't process URI " + requestURI);
>  
>  
>  
>  
>


-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }



Mime
View raw message