cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject cvs commit: xml-cocoon2/src/java/org/apache/cocoon/sitemap Handler.java
Date Thu, 21 Feb 2002 00:08:13 GMT
vgritsenko    02/02/20 16:08:13

  Modified:    src/java/org/apache/cocoon/sitemap Handler.java
  Log:
  Unclutter [core] log category: feed sitemap with sitemap handler's logger instead of program
generator's logger.
  
  Revision  Changes    Path
  1.10      +11 -6     xml-cocoon2/src/java/org/apache/cocoon/sitemap/Handler.java
  
  Index: Handler.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/sitemap/Handler.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- Handler.java	7 Feb 2002 04:37:42 -0000	1.9
  +++ Handler.java	21 Feb 2002 00:08:13 -0000	1.10
  @@ -89,7 +89,7 @@
    * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
    * @author <a href="mailto:Giacomo.Pati@pwr.ch">Giacomo Pati</a>
    * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
  - * @version CVS $Id: Handler.java,v 1.9 2002/02/07 04:37:42 vgritsenko Exp $
  + * @version CVS $Id: Handler.java,v 1.10 2002/02/21 00:08:13 vgritsenko Exp $
    */
   public class Handler extends AbstractLoggable
   implements Runnable, Contextualizable, Composable, Processor, Disposable, SourceResolver
{
  @@ -270,13 +270,19 @@
                * XSLTFactoryLoader, since it is created by the Xalan engine.
                */
               XSLTFactoryLoader.setLogger(getLogger());
  +
               programGenerator = (ProgramGenerator)this.manager.lookup(ProgramGenerator.ROLE);
               smap = (Sitemap)programGenerator.load(this.manager, this.sourceFileName, markupLanguage,
                       programmingLanguage, this);
  -            if (this.sitemap != null) {
  -                programGenerator.release((CompiledComponent)this.sitemap);
  +            if (smap instanceof AbstractLoggable) {
  +                ((AbstractLoggable)smap).setLogger(getLogger());
               }
  +
  +            // Swap old and new sitemaps
  +            Sitemap oldSitemap = this.sitemap;
               this.sitemap = smap;
  +            programGenerator.release((CompiledComponent)oldSitemap);
  +
               // add the source factory for the cocoon protocol
               this.sourceHandler.addFactory("cocoon",
                       new CocoonSourceFactory(this.sitemap, this.sitemap.getComponentManager()));
  @@ -292,9 +298,8 @@
                   this.exception = (Exception)t;
               }
           } finally {
  -            if (programGenerator != null) {
  -                this.manager.release(programGenerator);
  -            }
  +            this.manager.release(programGenerator);
  +
               this.regeneration = null;
               this.isRegenerationRunning = false;
               this.contextSource.recycle();
  
  
  

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