cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: xml-cocoon2/src/org/apache/cocoon/components/language/markup/sitemap/java sitemap.xsl
Date Tue, 19 Jun 2001 11:56:56 GMT
dims        01/06/19 04:56:56

  Modified:    src/org/apache/cocoon/components/language/markup/sitemap/java
                        sitemap.xsl
  Log:
  Patch from Vadim for preventing OutOfMemory errors.
  
  Revision  Changes    Path
  1.17      +17 -10    xml-cocoon2/src/org/apache/cocoon/components/language/markup/sitemap/java/sitemap.xsl
  
  Index: sitemap.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/language/markup/sitemap/java/sitemap.xsl,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- sitemap.xsl	2001/06/12 17:17:58	1.16
  +++ sitemap.xsl	2001/06/19 11:56:56	1.17
  @@ -127,7 +127,7 @@
        *
        * @author <a href="mailto:giacomo@apache.org">Giacomo Pati</a>
        * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
  -     * @version CVS $Id: sitemap.xsl,v 1.16 2001/06/12 17:17:58 dims Exp $
  +     * @version CVS $Id: sitemap.xsl,v 1.17 2001/06/19 11:56:56 dims Exp $
        */
       public class <xsl:value-of select="@file-name"/> extends AbstractSitemap {
         static final String LOCATION = "<xsl:value-of select="translate(@file-path, '/',
'.')"/>.<xsl:value-of select="@file-name"/>";
  @@ -406,19 +406,23 @@
         public boolean process(Environment environment) throws Exception {
           /* the &lt;code&gt;EventPipeline&lt;/code&gt; is used to collect
the xml producing sitemap
              components and the &lt;code&gt;StreamPipeline&lt;/code&gt; to
produce the requested resource */
  -        EventPipeline eventPipeline = (EventPipeline)this.manager.lookup(Roles.EVENT_PIPELINE);
  -        StreamPipeline pipeline = (StreamPipeline)this.manager.lookup(Roles.STREAM_PIPELINE);
  -        eventPipeline.setSitemap(this);
  -        pipeline.setEventPipeline(eventPipeline);
  +        EventPipeline eventPipeline = null;
  +        StreamPipeline pipeline = null;
           boolean result = false;
           try {
  -           result = process (environment, pipeline, eventPipeline, false);
  +          eventPipeline = (EventPipeline)this.manager.lookup(Roles.EVENT_PIPELINE);
  +          pipeline = (StreamPipeline)this.manager.lookup(Roles.STREAM_PIPELINE);
  +          eventPipeline.setSitemap(this);
  +          pipeline.setEventPipeline(eventPipeline);
  +          result = process (environment, pipeline, eventPipeline, false);
           } catch (Exception e) {
             getLogger().error("processing of resource failed", e);
             throw e;
           } finally {
  -          manager.release(eventPipeline);
  -          manager.release(pipeline);
  +          if(eventPipeline != null)
  +            manager.release(eventPipeline);
  +          if(pipeline != null)
  +            manager.release(pipeline);
           }
           return result;
         }
  @@ -507,8 +511,8 @@
           <xsl:if test="(./map:handle-errors)">
             private boolean error_process_<xsl:value-of select="$pipeline-position"/>
(Environment environment, Map objectModel, Exception e, boolean internalRequest)
             throws Exception {
  -            StreamPipeline pipeline = null;
               EventPipeline eventPipeline = null;
  +            StreamPipeline pipeline = null;
               try {
                 eventPipeline = (EventPipeline)this.manager.lookup(Roles.EVENT_PIPELINE);
                 pipeline = (StreamPipeline)this.manager.lookup(Roles.STREAM_PIPELINE);
  @@ -523,7 +527,10 @@
                 getLogger().error("error notifier barfs", ex);
                 throw e;
               } finally {
  -              this.manager.release(pipeline);
  +              if(eventPipeline != null)
  +                this.manager.release(eventPipeline);
  +              if(pipeline != null)
  +                this.manager.release(pipeline);
               }
               return false;
             }
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message