cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject cvs commit: cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap FlowNode.java MountNode.java
Date Tue, 08 Jun 2004 13:09:28 GMT
cziegeler    2004/06/08 06:09:27

  Modified:    .        status.xml
               src/java/org/apache/cocoon/components/treeprocessor/sitemap
                        FlowNode.java MountNode.java
  Log:
  Apply patch (bug 27066) to fix some memory leaks in the tree processor.
  
  Revision  Changes    Path
  1.357     +4 -1      cocoon-2.1/status.xml
  
  Index: status.xml
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/status.xml,v
  retrieving revision 1.356
  retrieving revision 1.357
  diff -u -r1.356 -r1.357
  --- status.xml	7 Jun 2004 10:29:09 -0000	1.356
  +++ status.xml	8 Jun 2004 13:09:24 -0000	1.357
  @@ -205,6 +205,9 @@
     <changes>
   
    <release version="@version@" date="@date@">
  +   <action dev="CZ" type="fix" fixes-bug="27066">
  +     Apply patch to fix some memory leaks in the tree processor.
  +   </action>
      <action dev="CZ" type="fix" fixes-bug="29373">
        Portal: Fix NPE when non-caching pipelines are used for the portal profile.
      </action>
  
  
  
  1.5       +25 -4     cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/FlowNode.java
  
  Index: FlowNode.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/FlowNode.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- FlowNode.java	5 Mar 2004 13:02:52 -0000	1.4
  +++ FlowNode.java	8 Jun 2004 13:09:27 -0000	1.5
  @@ -15,6 +15,8 @@
    */
   package org.apache.cocoon.components.treeprocessor.sitemap;
   
  +import org.apache.avalon.framework.activity.Disposable;
  +import org.apache.avalon.framework.component.Component;
   import org.apache.avalon.framework.component.ComponentException;
   import org.apache.avalon.framework.component.ComponentManager;
   import org.apache.avalon.framework.component.ComponentSelector;
  @@ -36,12 +38,13 @@
    * @version CVS $Id$
    */
   public class FlowNode extends AbstractProcessingNode
  -        implements Composable, Contextualizable {
  +        implements Composable, Contextualizable, Disposable {
   
       ComponentManager manager;
       String language;
       Context context;
       Interpreter interpreter;
  +    ComponentSelector interpreterSelector;
   
       public FlowNode(String language) {
           this.language = language;
  @@ -79,13 +82,31 @@
           this.manager = manager;
   
           try {
  -            ComponentSelector selector = (ComponentSelector)manager.lookup(Interpreter.ROLE);
  +            this.interpreterSelector = (ComponentSelector)manager.lookup(Interpreter.ROLE);
               // Obtain the Interpreter instance for this language
  -            interpreter = (Interpreter)selector.select(language);
  +            this.interpreter = (Interpreter)this.interpreterSelector.select(language);
  +        } catch (ComponentException ce) {
  +            throw ce;
           } catch (Exception ex) {
               throw new ComponentException(language,
                   "ScriptNode: Couldn't obtain a flow interpreter for " + language + ": "
+ ex);
           }
  +    }
  +
  +    /* (non-Javadoc)
  +     * @see org.apache.avalon.framework.activity.Disposable#dispose()
  +     */
  +    public void dispose() {
  +        if ( this.manager != null ) {
  +            if ( this.interpreterSelector != null ) {
  +                this.interpreterSelector.release( (Component)this.interpreter );
  +                this.interpreter = null;
  +                this.manager.release( this.interpreterSelector );
  +                this.interpreterSelector = null;
  +            }
  +            this.manager = null;
  +        }
  +
       }
   
       public Interpreter getInterpreter() {
  
  
  
  1.14      +8 -3      cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/MountNode.java
  
  Index: MountNode.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/MountNode.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- MountNode.java	25 May 2004 07:28:25 -0000	1.13
  +++ MountNode.java	8 Jun 2004 13:09:27 -0000	1.14
  @@ -19,6 +19,7 @@
   import java.util.Iterator;
   import java.util.Map;
   
  +import org.apache.avalon.framework.activity.Disposable;
   import org.apache.cocoon.ProcessingException;
   import org.apache.cocoon.Processor;
   import org.apache.cocoon.components.treeprocessor.AbstractProcessingNode;
  @@ -33,7 +34,8 @@
    * @author <a href="mailto:sylvain@apache.org">Sylvain Wallez</a>
    * @version CVS $Id$
    */
  -public class MountNode extends AbstractProcessingNode {
  +public class MountNode extends AbstractProcessingNode 
  +implements Disposable {
   
       /** The 'uri-prefix' attribute */
       private final VariableResolver prefix;
  @@ -125,7 +127,10 @@
           return processor;
       }
   
  -    public void dispose() {
  +    /* (non-Javadoc)
  +     * @see org.apache.avalon.framework.activity.Disposable#dispose()
  +     */
  +    public void dispose() {       
           Iterator iter = this.processors.values().iterator();
           while(iter.hasNext()) {
               ((TreeProcessor)iter.next()).dispose();
  
  
  

Mime
View raw message