Return-Path: Delivered-To: apmail-xml-cocoon-cvs-archive@xml.apache.org Received: (qmail 76649 invoked by uid 500); 19 Jun 2001 11:56:57 -0000 Mailing-List: contact cocoon-cvs-help@xml.apache.org; run by ezmlm Precedence: bulk Reply-To: cocoon-dev@xml.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cocoon-cvs@xml.apache.org Received: (qmail 76640 invoked by uid 500); 19 Jun 2001 11:56:57 -0000 Delivered-To: apmail-xml-cocoon2-cvs@apache.org Date: 19 Jun 2001 11:56:56 -0000 Message-ID: <20010619115656.76636.qmail@apache.org> From: dims@apache.org To: xml-cocoon2-cvs@apache.org Subject: cvs commit: xml-cocoon2/src/org/apache/cocoon/components/language/markup/sitemap/java sitemap.xsl 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 extends AbstractSitemap { static final String LOCATION = "."; @@ -406,19 +406,23 @@ public boolean process(Environment environment) throws Exception { /* the <code>EventPipeline</code> is used to collect the xml producing sitemap components and the <code>StreamPipeline</code> 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 @@ private boolean error_process_ (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