cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject cvs commit: xml-cocoon2/src/java/org/apache/cocoon/sitemap AbstractSitemap.java DefaultSitemapComponentSelector.java
Date Mon, 22 Apr 2002 13:44:23 GMT
cziegeler    02/04/22 06:44:23

  Modified:    src/java/org/apache/cocoon/components/treeprocessor/sitemap
                        SitemapLanguage.java
               src/java/org/apache/cocoon/sitemap AbstractSitemap.java
                        DefaultSitemapComponentSelector.java
  Log:
  Releasing of components
  
  Revision  Changes    Path
  1.5       +6 -3      xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/SitemapLanguage.java
  
  Index: SitemapLanguage.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/SitemapLanguage.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SitemapLanguage.java	26 Mar 2002 10:57:02 -0000	1.4
  +++ SitemapLanguage.java	22 Apr 2002 13:44:23 -0000	1.5
  @@ -82,7 +82,7 @@
    * The tree builder for the sitemap language.
    *
    * @author <a href="mailto:sylvain@apache.org">Sylvain Wallez</a>
  - * @version CVS $Id: SitemapLanguage.java,v 1.4 2002/03/26 10:57:02 sylvain Exp $
  + * @version CVS $Id: SitemapLanguage.java,v 1.5 2002/04/22 13:44:23 cziegeler Exp $
    */
   
   public class SitemapLanguage extends DefaultTreeBuilder {
  @@ -176,7 +176,7 @@
   
       public void recycle() {
           super.recycle();
  -        
  +
           // Go back to initial state
           this.labelViews.clear();
           this.viewsNode = null;
  @@ -247,8 +247,9 @@
           Set labels = new HashSet();
   
           // 1 - labels defined on the component
  +        SitemapComponentSelector selector = null;
           try {
  -            SitemapComponentSelector selector = (SitemapComponentSelector)this.manager.lookup(role
+ "Selector");
  +            selector = (SitemapComponentSelector)this.manager.lookup(role + "Selector");
               String[] compLabels = selector.getLabels(hint);
               if (compLabels != null) {
                   for (int i = 0; i < compLabels.length; i++) {
  @@ -258,6 +259,8 @@
           } catch(Exception e) {
               // Ignore (no selector for this role)
               getLogger().debug("No selector for role " + role);
  +        } finally {
  +            this.manager.release( selector );
           }
   
           // 2 - labels defined on this statement
  
  
  
  1.12      +37 -17    xml-cocoon2/src/java/org/apache/cocoon/sitemap/AbstractSitemap.java
  
  Index: AbstractSitemap.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/sitemap/AbstractSitemap.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- AbstractSitemap.java	19 Apr 2002 19:38:11 -0000	1.11
  +++ AbstractSitemap.java	22 Apr 2002 13:44:23 -0000	1.12
  @@ -91,7 +91,7 @@
    * Base class for generated <code>Sitemap</code> classes
    *
    * @author <a href="mailto:Giacomo.Pati@pwr.ch">Giacomo Pati</a>
  - * @version CVS $Id: AbstractSitemap.java,v 1.11 2002/04/19 19:38:11 vgritsenko Exp $
  + * @version CVS $Id: AbstractSitemap.java,v 1.12 2002/04/22 13:44:23 cziegeler Exp $
    */
   public abstract class AbstractSitemap extends AbstractLoggable implements Sitemap, Disposable,
ThreadSafe {
       private Context context;
  @@ -453,28 +453,48 @@
           manager.release(this.urlFactory);
           this.urlFactory = null;
   
  -        manager.release(this.generators);
  -        this.generators = null;
  -
  -        manager.release(this.transformers);
  -        this.transformers = null;
  +        if ( this.generators != null) {
  +            this.manager.release( this.generators.getParentSelector() );
  +            this.manager.release(this.generators);
  +            this.generators = null;
  +        }
  +        if ( this.transformers != null ) {
  +            this.manager.release( this.transformers.getParentSelector() );
  +            this.manager.release(this.transformers);
  +            this.transformers = null;
  +        }
   
  -        manager.release(this.serializers);
  -        this.serializers = null;
  +        if ( this.serializers != null ) {
  +            this.manager.release( this.serializers.getParentSelector() );
  +            this.manager.release(this.serializers);
  +            this.serializers = null;
  +        }
   
  -        manager.release(this.readers);
  -        this.readers = null;
  +        if ( this.readers != null ) {
  +            this.manager.release( this.readers.getParentSelector() );
  +            this.manager.release(this.readers);
  +            this.readers = null;
  +        }
   
  -        manager.release(this.actions);
  -        this.actions = null;
  +        if ( this.actions != null ) {
  +            this.manager.release( this.actions.getParentSelector() );
  +            this.manager.release(this.actions);
  +            this.actions = null;
  +        }
   
  -        manager.release(this.matchers);
  -        this.matchers = null;
  +        if ( this.matchers != null ) {
  +            this.manager.release( this.matchers.getParentSelector() );
  +            this.manager.release(this.matchers);
  +            this.matchers = null;
  +        }
   
  -        manager.release(this.selectors);
  -        this.selectors = null;
  +        if ( this.selectors != null ) {
  +            this.manager.release( this.selectors.getParentSelector() );
  +            this.manager.release(this.selectors);
  +            this.selectors = null;
  +        }
   
  -        manager = null;
  +        this.manager = null;
       }
   
       /**
  
  
  
  1.3       +9 -1      xml-cocoon2/src/java/org/apache/cocoon/sitemap/DefaultSitemapComponentSelector.java
  
  Index: DefaultSitemapComponentSelector.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/sitemap/DefaultSitemapComponentSelector.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DefaultSitemapComponentSelector.java	22 Feb 2002 07:03:55 -0000	1.2
  +++ DefaultSitemapComponentSelector.java	22 Apr 2002 13:44:23 -0000	1.3
  @@ -67,7 +67,7 @@
    *
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
    * @author <a href="mailto:giacomo@apache.org">Giacomo Pati</a>
  - * @version CVS $Id: DefaultSitemapComponentSelector.java,v 1.2 2002/02/22 07:03:55 cziegeler
Exp $
  + * @version CVS $Id: DefaultSitemapComponentSelector.java,v 1.3 2002/04/22 13:44:23 cziegeler
Exp $
    */
   public class DefaultSitemapComponentSelector extends ExcaliburComponentSelector
     implements SitemapComponentSelector {
  @@ -92,6 +92,14 @@
           if (this.parentSelector == null) {
               this.parentSelector = newSelector;
           }
  +    }
  +
  +    /**
  +     * Get the parent selector.
  +     * This is mainly used for releasing the parent selector
  +     */
  +    public SitemapComponentSelector getParentSelector() {
  +        return this.parentSelector;
       }
   
       public Component select(Object hint) throws ComponentException {
  
  
  

----------------------------------------------------------------------
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