cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From blorit...@apache.org
Subject cvs commit: xml-cocoon/src/org/apache/cocoon/xml/dom DOMBuilder.java SVGBuilder.java
Date Mon, 22 Jan 2001 21:56:57 GMT
bloritsch    01/01/22 13:56:56

  Modified:    src/org/apache/cocoon Tag: xml-cocoon2 Cocoon.java
                        CocoonComponentSelector.java ComponentFactory.java
                        DefaultComponentManager.java Main.java
               src/org/apache/cocoon/acting Tag: xml-cocoon2
                        AbstractAction.java
               src/org/apache/cocoon/components/classloader Tag:
                        xml-cocoon2 RepositoryClassLoader.java
               src/org/apache/cocoon/components/datasource Tag: xml-cocoon2
                        J2eeDataSource.java JdbcConnection.java
                        JdbcConnectionPool.java JdbcDataSource.java
               src/org/apache/cocoon/components/language/generator Tag:
                        xml-cocoon2 ProgramGeneratorImpl.java
               src/org/apache/cocoon/components/language/markup Tag:
                        xml-cocoon2 AbstractMarkupLanguage.java
                        Logicsheet.java LogicsheetCodeGenerator.java
               src/org/apache/cocoon/components/language/markup/sitemap
                        Tag: xml-cocoon2 SitemapMarkupLanguage.java
               src/org/apache/cocoon/components/language/markup/xsp Tag:
                        xml-cocoon2 XSPGenerator.java
                        XSPMarkupLanguage.java XSPObjectHelper.java
               src/org/apache/cocoon/components/language/markup/xsp/java
                        Tag: xml-cocoon2 esql.xsl
               src/org/apache/cocoon/components/language/programming Tag:
                        xml-cocoon2 AbstractProgrammingLanguage.java
               src/org/apache/cocoon/components/language/programming/java
                        Tag: xml-cocoon2 AbstractJavaCompiler.java
                        JstyleFormatter.java
               src/org/apache/cocoon/components/store Tag: xml-cocoon2
                        FilesystemStore.java
               src/org/apache/cocoon/environment Tag: xml-cocoon2
                        AbstractEnvironment.java
               src/org/apache/cocoon/environment/commandline Tag:
                        xml-cocoon2 FileSavingEnvironment.java
                        LinkSamplingEnvironment.java
               src/org/apache/cocoon/generation Tag: xml-cocoon2
                        ServerPagesGenerator.java
               src/org/apache/cocoon/matching Tag: xml-cocoon2
                        RegexpTargetHostMatcherFactory.java
                        RegexpURIMatcherFactory.java
                        WildcardURIMatcherFactory.java
               src/org/apache/cocoon/reading Tag: xml-cocoon2
                        AbstractReader.java
               src/org/apache/cocoon/servlet Tag: xml-cocoon2
                        CocoonServlet.java
               src/org/apache/cocoon/sitemap Tag: xml-cocoon2
                        AbstractSitemap.java ComponentHolderFactory.java
                        DefaultComponentHolder.java Handler.java
                        Manager.java PoolableComponentHolder.java
                        ThreadSafeComponentHolder.java
                        XSLTFactoryLoader.java
               src/org/apache/cocoon/transformation Tag: xml-cocoon2
                        I18nTransformer.java SQLTransformer.java
                        XIncludeTransformer.java XTTransformer.java
                        XalanTransformer.java
               src/org/apache/cocoon/util Tag: xml-cocoon2
                        ComponentPool.java ComponentPoolController.java
               src/org/apache/cocoon/xml Tag: xml-cocoon2
                        AbstractXMLConsumer.java AbstractXMLProducer.java
                        ContentHandlerWrapper.java
                        DocumentHandlerWrapper.java
               src/org/apache/cocoon/xml/dom Tag: xml-cocoon2
                        DOMBuilder.java SVGBuilder.java
  Log:
  Updating to make Loggable interface and new Avalon
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.4.2.45  +37 -25    xml-cocoon/src/org/apache/cocoon/Cocoon.java
  
  Index: Cocoon.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/Cocoon.java,v
  retrieving revision 1.4.2.44
  retrieving revision 1.4.2.45
  diff -u -r1.4.2.44 -r1.4.2.45
  --- Cocoon.java	2001/01/17 18:33:35	1.4.2.44
  +++ Cocoon.java	2001/01/22 21:56:32	1.4.2.45
  @@ -27,6 +27,7 @@
   import org.apache.avalon.Configuration;
   import org.apache.avalon.SAXConfigurationHandler;
   import org.apache.avalon.ConfigurationException;
  +import org.apache.avalon.Initializable;
   
   import org.apache.cocoon.components.parser.Parser;
   import org.apache.cocoon.environment.Environment;
  @@ -37,7 +38,7 @@
   import org.apache.cocoon.DefaultComponentManager;
   
   import org.apache.log.Logger;
  -import org.apache.log.LogKit;
  +import org.apache.avalon.Loggable;
   
   import org.xml.sax.SAXException;
   import org.xml.sax.InputSource;
  @@ -46,12 +47,12 @@
    * @author <a href="mailto:fumagalli@exoffice.com">Pierpaolo Fumagalli</a>
    *         (Apache Software Foundation, Exoffice Technologies)
    * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
  - * @version CVS $Revision: 1.4.2.44 $ $Date: 2001/01/17 18:33:35 $
  + * @version CVS $Revision: 1.4.2.45 $ $Date: 2001/01/22 21:56:32 $
    */
   public class Cocoon
  -  implements Component, Configurable, ComponentManager, Modifiable, Processor, Constants {
  +  implements Component, Configurable, ComponentManager, Modifiable, Processor, Constants, Loggable {
   
  -    private Logger log = LogKit.getLoggerFor("cocoon");
  +    private Logger log;
   
       /** The table of role-class */
       private HashMap components = new HashMap();
  @@ -87,22 +88,8 @@
        * Create a new <code>Cocoon</code> instance.
        */
       protected Cocoon() throws ConfigurationException {
  -        log.debug("New Cocoon object.");
           // Set the system properties needed by Xalan2.
           setSystemProperties();
  -
  -        // Setup the default parser, for parsing configuration.
  -        // If one need to use a different parser, set the given system property
  -        String parser = System.getProperty(PARSER_PROPERTY, DEFAULT_PARSER);
  -        log.debug("Using parser: " + parser);
  -
  -        try {
  -            this.componentManager.addComponent(Roles.PARSER, ClassUtils.loadClass(parser),null);
  -        } catch ( Exception e ) {
  -            log.error("Could not load parser, Cocoon object not created.", e);
  -            throw new ConfigurationException("Could not load parser " + parser, e);
  -        }
  -        this.componentManager.addComponentInstance(Roles.COCOON, this);
       }
   
       /**
  @@ -117,13 +104,41 @@
           this();
   
           this.classpath = classpath;
  +        this.workDir = workDir;
  +        this.configurationFile = configurationFile;
  +
  +        File rootFile = new File(root);
  +        NetUtils.setRoot(rootFile);
  +        this.root = rootFile.toURL();
  +    }
  +
  +    public void setLogger(Logger logger) {
  +        if (this.log == null) {
  +            this.log = logger;
  +            this.componentManager.setLogger(this.log);
  +        }
  +    }
  +
  +    public void init() throws Exception {
  +        log.debug("New Cocoon object.");
  +
  +        // Setup the default parser, for parsing configuration.
  +        // If one need to use a different parser, set the given system property
  +        String parser = System.getProperty(PARSER_PROPERTY, DEFAULT_PARSER);
  +        log.debug("Using parser: " + parser);
  +
  +        try {
  +            this.componentManager.addComponent(Roles.PARSER, ClassUtils.loadClass(parser),null);
  +        } catch ( Exception e ) {
  +            log.error("Could not load parser, Cocoon object not created.", e);
  +            throw new ConfigurationException("Could not load parser " + parser, e);
  +        }
  +        this.componentManager.addComponentInstance(Roles.COCOON, this);
  +
           log.debug("Classpath = " + classpath);
   
  -        this.workDir = workDir;
           log.debug("Work directory = " + workDir.getCanonicalPath());
   
  -        this.configurationFile = configurationFile;
  -
           Parser p = (Parser) this.lookup(Roles.PARSER);
           SAXConfigurationHandler b = new SAXConfigurationHandler();
           InputSource is = new InputSource(this.configurationFile.openStream());
  @@ -133,10 +148,6 @@
           p.parse(is);
   
           this.configure(b.getConfiguration());
  -
  -        File rootFile = new File(root);
  -        NetUtils.setRoot(rootFile);
  -        this.root = rootFile.toURL();
       }
   
       /**
  @@ -191,6 +202,7 @@
           Configuration sconf = conf.getChild("sitemap");
   
           this.sitemapManager = new Manager(null);
  +        this.sitemapManager.setLogger(this.log);
           this.sitemapManager.compose(this);
           this.sitemapManager.configure(conf);
           this.sitemapFileName = sconf.getAttribute("file");
  
  
  
  1.1.2.14  +20 -8     xml-cocoon/src/org/apache/cocoon/Attic/CocoonComponentSelector.java
  
  Index: CocoonComponentSelector.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/Attic/CocoonComponentSelector.java,v
  retrieving revision 1.1.2.13
  retrieving revision 1.1.2.14
  diff -u -r1.1.2.13 -r1.1.2.14
  --- CocoonComponentSelector.java	2001/01/18 22:02:14	1.1.2.13
  +++ CocoonComponentSelector.java	2001/01/22 21:56:32	1.1.2.14
  @@ -35,15 +35,15 @@
   import org.apache.cocoon.util.ComponentPoolController;
   
   import org.apache.log.Logger;
  -import org.apache.log.LogKit;
  +import org.apache.avalon.Loggable;
   
   /** Default component manager for Cocoon's non sitemap components.
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
    * @author <a href="mailto:paul@luminas.co.uk">Paul Russell</a>
  - * @version CVS $Revision: 1.1.2.13 $ $Date: 2001/01/18 22:02:14 $
  + * @version CVS $Revision: 1.1.2.14 $ $Date: 2001/01/22 21:56:32 $
    */
  -public class CocoonComponentSelector implements ComponentSelector, Composer, Configurable, ThreadSafe {
  -    protected Logger log = LogKit.getLoggerFor("cocoon");
  +public class CocoonComponentSelector implements ComponentSelector, Composer, Configurable, ThreadSafe, Loggable {
  +    protected Logger log;
       /** Hashmap of all components which this ComponentManager knows about.
        */
       private Map components;
  @@ -73,6 +73,12 @@
           instances = Collections.synchronizedMap(new HashMap());
       }
   
  +    public void setLogger(Logger logger) {
  +        if (this.log == null) {
  +            this.log = logger;
  +        }
  +    }
  +
       /** Implement Composer interface
        */
       public void compose(ComponentManager manager)
  @@ -208,10 +214,12 @@
   
           if ( pool == null ) {
               try {
  -                pool = new ComponentPool(
  -                    new ComponentFactory(componentClass, (Configuration)configurations.get(hint), this.manager),
  -                    new ComponentPoolController()
  -                    );
  +                ComponentFactory cf = new ComponentFactory(componentClass, (Configuration)configurations.get(hint), this.manager);
  +                cf.setLogger(this.log);
  +
  +                pool = new ComponentPool(cf, new ComponentPoolController());
  +                pool.setLogger(this.log);
  +                pool.init();
               } catch (Exception e) {
                   log.error("Could not create pool for component " + componentClass.getName(), e);
                   throw new ComponentNotAccessibleException(
  @@ -242,6 +250,10 @@
        */
       private void setupComponent(Object hint, Component c)
       throws ComponentManagerException {
  +        if ( c instanceof Loggable ) {
  +            ((Loggable)c).setLogger(this.log);
  +        }
  +
           if ( c instanceof Configurable ) {
               try {
                   ((Configurable)c).configure(
  
  
  
  1.1.2.6   +14 -4     xml-cocoon/src/org/apache/cocoon/Attic/ComponentFactory.java
  
  Index: ComponentFactory.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/Attic/ComponentFactory.java,v
  retrieving revision 1.1.2.5
  retrieving revision 1.1.2.6
  diff -u -r1.1.2.5 -r1.1.2.6
  --- ComponentFactory.java	2000/12/11 16:06:26	1.1.2.5
  +++ ComponentFactory.java	2001/01/22 21:56:32	1.1.2.6
  @@ -18,14 +18,14 @@
   import org.apache.avalon.ThreadSafe;
   
   import org.apache.log.Logger;
  -import org.apache.log.LogKit;
  +import org.apache.avalon.Loggable;
   
   /** Factory for Cocoon components.
    * @author <a href="mailto:paul@luminas.co.uk">Paul Russell</a>
  - * @version CVS $Revision: 1.1.2.5 $ $Date: 2000/12/11 16:06:26 $
  + * @version CVS $Revision: 1.1.2.6 $ $Date: 2001/01/22 21:56:32 $
    */
  -public class ComponentFactory implements ObjectFactory, ThreadSafe {
  -    private Logger log = LogKit.getLoggerFor("cocoon");
  +public class ComponentFactory implements ObjectFactory, ThreadSafe, Loggable {
  +    private Logger log;
   
       /** The class which this <code>ComponentFactory</code>
        * should create.
  @@ -51,12 +51,22 @@
           this.manager = manager;
       }
   
  +    public void setLogger(Logger logger) {
  +        if (this.log == null) {
  +            this.log = logger;
  +        }
  +    }
  +
       public Poolable newInstance() throws Exception {
           Poolable comp = (Poolable)componentClass.newInstance();
   
           log.debug("ComponentFactory creating new instance of "
               + componentClass.getName() + "."
           );
  +
  +        if ( comp instanceof Loggable) {
  +            ((Loggable)comp).setLogger(this.log);
  +        }
   
           if ( comp instanceof Configurable ) {
               ((Configurable)comp).configure(this.conf);
  
  
  
  1.1.2.13  +23 -11    xml-cocoon/src/org/apache/cocoon/Attic/DefaultComponentManager.java
  
  Index: DefaultComponentManager.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/Attic/DefaultComponentManager.java,v
  retrieving revision 1.1.2.12
  retrieving revision 1.1.2.13
  diff -u -r1.1.2.12 -r1.1.2.13
  --- DefaultComponentManager.java	2001/01/18 22:02:16	1.1.2.12
  +++ DefaultComponentManager.java	2001/01/22 21:56:32	1.1.2.13
  @@ -34,15 +34,15 @@
   import org.apache.cocoon.CocoonComponentSelector;
   
   import org.apache.log.Logger;
  -import org.apache.log.LogKit;
  +import org.apache.avalon.Loggable;
   
   /** Default component manager for Cocoon's non sitemap components.
    * @author <a href="mailto:paul@luminas.co.uk">Paul Russell</a>
  - * @version CVS $Revision: 1.1.2.12 $ $Date: 2001/01/18 22:02:16 $
  + * @version CVS $Revision: 1.1.2.13 $ $Date: 2001/01/22 21:56:32 $
    */
  -public class DefaultComponentManager implements ComponentManager, Configurable {
  +public class DefaultComponentManager implements ComponentManager, Configurable, Loggable {
   
  -    protected Logger log = LogKit.getLoggerFor("cocoon");
  +    protected Logger log;
   
       /** Hashmap of all components which this ComponentManager knows about.
        */
  @@ -70,6 +70,12 @@
           instances = Collections.synchronizedMap(new HashMap());
       }
   
  +    public void setLogger(Logger logger) {
  +        if (this.log == null) {
  +            this.log = logger;
  +        }
  +    }
  +
       /** Return an instance of a component.
        */
       public Component lookup( String role )
  @@ -102,9 +108,9 @@
   
               this.components.put(role, componentClass);
   
  -	    if (Configurable.class.isAssignableFrom(componentClass)) {
  -	        this.configurations.put(role, new DefaultConfiguration("", "-"));
  -	    }
  +        if (Configurable.class.isAssignableFrom(componentClass)) {
  +            this.configurations.put(role, new DefaultConfiguration("", "-"));
  +        }
           }
   
           if ( !Component.class.isAssignableFrom(componentClass) ) {
  @@ -244,10 +250,12 @@
           if ( pool == null ) {
               try {
                   log.debug("Creating new component pool for " + componentClass.getName() + ".");
  -                pool = new ComponentPool(
  -                    new ComponentFactory(componentClass, (Configuration)configurations.get(role), this),
  -                    new ComponentPoolController()
  -                    );
  +                ComponentFactory cf = new ComponentFactory(componentClass, (Configuration)configurations.get(role), this);
  +                cf.setLogger(this.log);
  +
  +                pool = new ComponentPool(cf, new ComponentPoolController());
  +                pool.setLogger(this.log);
  +                pool.init();
               } catch (Exception e) {
                   log.error("Could not create pool for component " + componentClass.getName(), e);
                   throw new ComponentNotAccessibleException(
  @@ -278,6 +286,10 @@
        */
       private void setupComponent(String role, Component c)
       throws ComponentManagerException {
  +        if ( c instanceof Loggable ) {
  +            ((Loggable)c).setLogger(this.log);
  +        }
  +
           if ( c instanceof Configurable ) {
               try {
                   ((Configurable)c).configure(
  
  
  
  1.1.4.18  +5 -2      xml-cocoon/src/org/apache/cocoon/Attic/Main.java
  
  Index: Main.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/Attic/Main.java,v
  retrieving revision 1.1.4.17
  retrieving revision 1.1.4.18
  diff -u -r1.1.4.17 -r1.1.4.18
  --- Main.java	2000/12/11 15:05:47	1.1.4.17
  +++ Main.java	2001/01/22 21:56:32	1.1.4.18
  @@ -48,7 +48,7 @@
    * Command line entry point.
    *
    * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
  - * @version CVS $Revision: 1.1.4.17 $ $Date: 2000/12/11 15:05:47 $
  + * @version CVS $Revision: 1.1.4.18 $ $Date: 2001/01/22 21:56:32 $
    */
   
   public class Main {
  @@ -191,7 +191,10 @@
               File work = getDir(workDir, "working");
               File context = getDir(contextDir, "context");
               File conf = getConfigurationFile(context);
  -            Main main = new Main(new Cocoon(conf.toURL(), null, work, context.getCanonicalPath()), context, dest);
  +            Cocoon c = new Cocoon(conf.toURL(), null, work, context.getCanonicalPath());
  +            c.setLogger(log);
  +            c.init();
  +            Main main = new Main(c, context, dest);
               main.warmup();
               main.process(targets);
               log.info("Done");
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.2   +10 -4     xml-cocoon/src/org/apache/cocoon/acting/Attic/AbstractAction.java
  
  Index: AbstractAction.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/acting/Attic/AbstractAction.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- AbstractAction.java	2000/12/06 22:54:09	1.1.2.1
  +++ AbstractAction.java	2001/01/22 21:56:33	1.1.2.2
  @@ -8,17 +8,23 @@
   package org.apache.cocoon.acting;
   
   import org.apache.avalon.Configurable;
  +import org.apache.avalon.Loggable;
   
   import org.apache.log.Logger;
  -import org.apache.log.LogKit;
   
   /**
    *
    * @author <a href="mailto:Giacomo.Pati@pwr.ch">Giacomo Pati</a>
  - * @version CVS $Revision: 1.1.2.1 $ $Date: 2000/12/06 22:54:09 $
  + * @version CVS $Revision: 1.1.2.2 $ $Date: 2001/01/22 21:56:33 $
    */
  -public abstract class AbstractAction implements Action, Configurable {
  +public abstract class AbstractAction implements Action, Configurable, Loggable {
   
  -    protected Logger log = LogKit.getLoggerFor("cocoon");
  +    protected Logger log;
  +
  +    public void setLogger(Logger logger) {
  +        if (this.log == null) {
  +            this.log = logger;
  +        }
  +    }
   
   }
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.17  +10 -4     xml-cocoon/src/org/apache/cocoon/components/classloader/Attic/RepositoryClassLoader.java
  
  Index: RepositoryClassLoader.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/components/classloader/Attic/RepositoryClassLoader.java,v
  retrieving revision 1.1.2.16
  retrieving revision 1.1.2.17
  diff -u -r1.1.2.16 -r1.1.2.17
  --- RepositoryClassLoader.java	2000/12/19 13:00:59	1.1.2.16
  +++ RepositoryClassLoader.java	2001/01/22 21:56:33	1.1.2.17
  @@ -22,8 +22,8 @@
   import org.apache.cocoon.util.IOUtils;
   import org.apache.cocoon.util.ClassUtils;
   
  +import org.apache.avalon.Loggable;
   import org.apache.log.Logger;
  -import org.apache.log.LogKit;
   
   /**
    * A class loader with a growable list of path search directories.
  @@ -33,19 +33,25 @@
    *
    * @author <a href="mailto:ricardo@apache.org">Ricardo Rocha</a>
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
  - * @version CVS $Revision: 1.1.2.16 $ $Date: 2000/12/19 13:00:59 $
  + * @version CVS $Revision: 1.1.2.17 $ $Date: 2001/01/22 21:56:33 $
    */
  -class RepositoryClassLoader extends URLClassLoader {
  +class RepositoryClassLoader extends URLClassLoader implements Loggable {
     /**
      * The logger
      */
  -  protected Logger log = LogKit.getLoggerFor("cocoon");
  +  protected Logger log;
   
     /**
      * Create an empty new class loader.
      */
     public RepositoryClassLoader() {
       super(new URL[] {}, ClassUtils.getClassLoader());
  +  }
  +
  +  public void setLogger(Logger logger) {
  +    if (this.log == null) {
  +      this.log = logger;
  +    }
     }
   
     /**
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.3   +10 -4     xml-cocoon/src/org/apache/cocoon/components/datasource/Attic/J2eeDataSource.java
  
  Index: J2eeDataSource.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/components/datasource/Attic/J2eeDataSource.java,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- J2eeDataSource.java	2001/01/10 22:07:03	1.1.2.2
  +++ J2eeDataSource.java	2001/01/22 21:56:33	1.1.2.3
  @@ -9,7 +9,7 @@
   
   import org.apache.avalon.Configuration;
   import org.apache.avalon.ConfigurationException;
  -import org.apache.log.LogKit;
  +import org.apache.avalon.Loggable;
   import org.apache.log.Logger;
   
   import javax.naming.Context;
  @@ -25,12 +25,18 @@
    * J2EE container pools the datasources properly.
    *
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
  - * @version CVS $Revision: 1.1.2.2 $ $Date: 2001/01/10 22:07:03 $
  + * @version CVS $Revision: 1.1.2.3 $ $Date: 2001/01/22 21:56:33 $
    */
  -public class J2eeDataSource implements DataSourceComponent {
  +public class J2eeDataSource implements DataSourceComponent, Loggable {
       final static String JDBC_NAME = "java:comp/env/jdbc/";
  -    Logger log = LogKit.getLoggerFor("cocoon");
  +    Logger log;
       DataSource ds = null;
  +
  +    public void setLogger(Logger logger) {
  +        if (this.log == null) {
  +            this.log = logger;
  +        }
  +    }
   
       /**
        *  Configure and set up DB connection.  Here we set the connection
  
  
  
  1.1.2.3   +9 -4      xml-cocoon/src/org/apache/cocoon/components/datasource/Attic/JdbcConnection.java
  
  Index: JdbcConnection.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/components/datasource/Attic/JdbcConnection.java,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- JdbcConnection.java	2001/01/11 21:01:45	1.1.2.2
  +++ JdbcConnection.java	2001/01/22 21:56:33	1.1.2.3
  @@ -20,7 +20,7 @@
   import org.apache.avalon.util.pool.Pool;
   
   import org.apache.log.Logger;
  -import org.apache.log.LogKit;
  +import org.apache.avalon.Loggable;
   
   /**
    * The Connection object used in conjunction with the JdbcDataSource
  @@ -31,16 +31,21 @@
    * total number of Connection objects that are created.
    *
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
  - * @version CVS $Revision: 1.1.2.2 $ $Date: 2001/01/11 21:01:45 $
  + * @version CVS $Revision: 1.1.2.3 $ $Date: 2001/01/22 21:56:33 $
    */
  -public class JdbcConnection implements Connection, Recyclable {
  +public class JdbcConnection implements Connection, Recyclable, Loggable {
       private Connection conn;
       private Pool pool;
  -    private Logger log = LogKit.getLoggerFor("cocoon");
  +    private Logger log;
   
       public JdbcConnection(Connection realConn, Pool parent) {
           this.conn = realConn;
           this.pool = parent;
  +    }
  +    public void setLogger(Logger logger) {
  +        if (this.log == null) {
  +            this.log = logger;
  +        }
       }
       public Statement createStatement() throws SQLException {
           return this.conn.createStatement();
  
  
  
  1.1.2.4   +13 -7     xml-cocoon/src/org/apache/cocoon/components/datasource/Attic/JdbcConnectionPool.java
  
  Index: JdbcConnectionPool.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/components/datasource/Attic/JdbcConnectionPool.java,v
  retrieving revision 1.1.2.3
  retrieving revision 1.1.2.4
  diff -u -r1.1.2.3 -r1.1.2.4
  --- JdbcConnectionPool.java	2001/01/10 13:44:00	1.1.2.3
  +++ JdbcConnectionPool.java	2001/01/22 21:56:34	1.1.2.4
  @@ -11,9 +11,9 @@
   import org.apache.avalon.Disposable;
   import org.apache.avalon.Poolable;
   import org.apache.avalon.Recyclable;
  -
  +import org.apache.avalon.Loggable;
  +import org.apache.avalon.Initializable;
   import org.apache.log.Logger;
  -import org.apache.log.LogKit;
   
   import java.sql.Connection;
   import java.sql.DriverManager;
  @@ -26,9 +26,9 @@
    * thread to manage the number of SQL Connections.
    *
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
  - * @version CVS $Revision: 1.1.2.3 $ $Date: 2001/01/10 13:44:00 $
  + * @version CVS $Revision: 1.1.2.4 $ $Date: 2001/01/22 21:56:34 $
    */
  -public class JdbcConnectionPool implements Pool, Runnable, Disposable {
  +public class JdbcConnectionPool implements Pool, Runnable, Disposable, Loggable, Initializable {
       private final String dburl;
       private final String username;
       private final String password;
  @@ -37,7 +37,7 @@
       private int currentCount = 0;
       private List active = new ArrayList();
       private List ready = new ArrayList();
  -    private Logger log = LogKit.getLoggerFor("cocoon");
  +    private Logger log;
       private boolean monitoring = true;
   
       public JdbcConnectionPool(String url, String username, String password, int min, int max) {
  @@ -58,11 +58,15 @@
           } else {
               this.max = max;
           }
  +    }
   
  -        initPool();
  +    public void setLogger (Logger logger) {
  +        if (this.log == null) {
  +            this.log = logger;
  +        }
       }
   
  -    private void initPool() {
  +    public void init() {
           for (int i = 0; i < min; i++) {
               this.ready.add(this.createJdbcConnection());
           }
  @@ -76,9 +80,11 @@
           try {
               if (username == null) {
                   conn = new JdbcConnection(DriverManager.getConnection(this.dburl), this);
  +                conn.setLogger(this.log);
                   currentCount++;
               } else {
                   conn = new JdbcConnection(DriverManager.getConnection(this.dburl, this.username, this.password), this);
  +                conn.setLogger(this.log);
                   currentCount++;
               }
           } catch (SQLException se) {
  
  
  
  1.1.2.8   +12 -4     xml-cocoon/src/org/apache/cocoon/components/datasource/Attic/JdbcDataSource.java
  
  Index: JdbcDataSource.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/components/datasource/Attic/JdbcDataSource.java,v
  retrieving revision 1.1.2.7
  retrieving revision 1.1.2.8
  diff -u -r1.1.2.7 -r1.1.2.8
  --- JdbcDataSource.java	2001/01/12 15:26:00	1.1.2.7
  +++ JdbcDataSource.java	2001/01/22 21:56:34	1.1.2.8
  @@ -10,7 +10,7 @@
   import org.apache.avalon.Configuration;
   import org.apache.avalon.ConfigurationException;
   import org.apache.avalon.Disposable;
  -import org.apache.log.LogKit;
  +import org.apache.avalon.Loggable;
   import org.apache.log.Logger;
   
   import java.sql.Connection;
  @@ -22,12 +22,18 @@
    * <code>java.sql.DriverManager</code>.
    *
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
  - * @version CVS $Revision: 1.1.2.7 $ $Date: 2001/01/12 15:26:00 $
  + * @version CVS $Revision: 1.1.2.8 $ $Date: 2001/01/22 21:56:34 $
    */
  -public class JdbcDataSource implements DataSourceComponent {
  -    Logger log = LogKit.getLoggerFor("cocoon");
  +public class JdbcDataSource implements DataSourceComponent, Loggable {
  +    Logger log;
       JdbcConnectionPool pool = null;
   
  +    public void setLogger(Logger logger) {
  +        if (this.log == null) {
  +            this.log = logger;
  +        }
  +    }
  +
       /**
        *  Configure and set up DB connection.  Here we set the connection
        *  information needed to create the Connection objects.  It must
  @@ -60,6 +66,8 @@
               int max = controler.getAttributeAsInt("max", 3);
   
               this.pool = new JdbcConnectionPool(dburl, user, passwd, min, max);
  +            this.pool.setLogger(this.log);
  +            this.pool.init();
           }
       }
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.21  +22 -4     xml-cocoon/src/org/apache/cocoon/components/language/generator/Attic/ProgramGeneratorImpl.java
  
  Index: ProgramGeneratorImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/components/language/generator/Attic/ProgramGeneratorImpl.java,v
  retrieving revision 1.1.2.20
  retrieving revision 1.1.2.21
  diff -u -r1.1.2.20 -r1.1.2.21
  --- ProgramGeneratorImpl.java	2000/12/11 17:09:40	1.1.2.20
  +++ ProgramGeneratorImpl.java	2001/01/22 21:56:34	1.1.2.21
  @@ -40,7 +40,7 @@
   import org.apache.cocoon.util.IOUtils;
   
   import org.apache.log.Logger;
  -import org.apache.log.LogKit;
  +import org.apache.avalon.Loggable;
   
   import org.w3c.dom.Document;
   import org.w3c.dom.Document;
  @@ -53,13 +53,13 @@
    * The default implementation of <code>ProgramGenerator</code>
    *
    * @author <a href="mailto:ricardo@apache.org">Ricardo Rocha</a>
  - * @version CVS $Revision: 1.1.2.20 $ $Date: 2000/12/11 17:09:40 $
  + * @version CVS $Revision: 1.1.2.21 $ $Date: 2001/01/22 21:56:34 $
    */
   public class ProgramGeneratorImpl
  -  implements ProgramGenerator, Composer, Configurable, ThreadSafe
  +  implements ProgramGenerator, Composer, Configurable, ThreadSafe, Loggable
   {
   
  -    private Logger log = LogKit.getLoggerFor("cocoon");
  +    private Logger log;
     /** The auto-reloading option */
     protected boolean autoReload = true;
   
  @@ -78,6 +78,12 @@
     /** The working directory */
     protected File workDir;
   
  +  public void setLogger(Logger logger) {
  +      if (this.log == null) {
  +          this.log = logger;
  +      }
  +  }
  +
     /**
      * Set the global component manager. This metod also sets the
      * <code>ComponentSelector</code> used as language factory for both
  @@ -140,10 +146,18 @@
   
       programmingLanguage.setLanguageName(programmingLanguageName);
   
  +    if (markupLanguage instanceof Loggable) {
  +        ((Loggable) markupLanguage).setLogger(this.log);
  +    }
  +
       if (markupLanguage instanceof Composer) {
           ((Composer) markupLanguage).compose(this.manager);
       }
   
  +    if (programmingLanguage instanceof Loggable) {
  +       ((Loggable) programmingLanguage).setLogger(this.log);
  +    }
  +
       if (programmingLanguage instanceof Composer) {
           ((Composer) programmingLanguage).compose(this.manager);
       }
  @@ -180,6 +194,9 @@
   
           // Instantiate program
           programInstance = programmingLanguage.instantiate(program);
  +        if (programInstance instanceof Loggable) {
  +            ((Loggable)programInstance).setLogger(this.log);
  +        }
         } catch (LanguageException e) { log.warn("Language Exception", e); }
   
         /*
  @@ -240,6 +257,7 @@
   
         // Instantiate
         programInstance = programmingLanguage.instantiate(program);
  +
       }
   
       return programInstance;
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.18  +10 -4     xml-cocoon/src/org/apache/cocoon/components/language/markup/Attic/AbstractMarkupLanguage.java
  
  Index: AbstractMarkupLanguage.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/components/language/markup/Attic/AbstractMarkupLanguage.java,v
  retrieving revision 1.1.2.17
  retrieving revision 1.1.2.18
  diff -u -r1.1.2.17 -r1.1.2.18
  --- AbstractMarkupLanguage.java	2001/01/16 17:04:22	1.1.2.17
  +++ AbstractMarkupLanguage.java	2001/01/22 21:56:34	1.1.2.18
  @@ -41,7 +41,7 @@
   import org.apache.cocoon.components.store.MemoryStore;
   import org.apache.cocoon.components.language.programming.ProgrammingLanguage;
   
  -import org.apache.log.LogKit;
  +import org.apache.avalon.Loggable;
   import org.apache.log.Logger;
   
   /**
  @@ -50,15 +50,15 @@
    * be decoupled from this context!!!
    *
    * @author <a href="mailto:ricardo@apache.org">Ricardo Rocha</a>
  - * @version CVS $Revision: 1.1.2.17 $ $Date: 2001/01/16 17:04:22 $
  + * @version CVS $Revision: 1.1.2.18 $ $Date: 2001/01/22 21:56:34 $
    */
   public abstract class AbstractMarkupLanguage
  -     implements MarkupLanguage, Composer, Configurable
  +     implements MarkupLanguage, Composer, Configurable, Loggable
   {
       /**
        * The logger for AbstractMarkupLanguage
        */
  -    protected Logger log = LogKit.getLoggerFor("cocoon");
  +    protected Logger log;
       /**
       * The supported language table
       */
  @@ -100,6 +100,12 @@
   
           // Initialize logicsheet cache
           this.logicsheetCache = new MemoryStore();
  +    }
  +
  +    public void setLogger(Logger logger) {
  +        if (this.log == null) {
  +            this.log = logger;
  +        }
       }
   
       /**
  
  
  
  1.1.2.11  +10 -4     xml-cocoon/src/org/apache/cocoon/components/language/markup/Attic/Logicsheet.java
  
  Index: Logicsheet.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/components/language/markup/Attic/Logicsheet.java,v
  retrieving revision 1.1.2.10
  retrieving revision 1.1.2.11
  diff -u -r1.1.2.10 -r1.1.2.11
  --- Logicsheet.java	2000/12/11 15:05:56	1.1.2.10
  +++ Logicsheet.java	2001/01/22 21:56:34	1.1.2.11
  @@ -39,7 +39,7 @@
   import javax.xml.transform.sax.SAXTransformerFactory;
   
   import org.apache.log.Logger;
  -import org.apache.log.LogKit;
  +import org.apache.avalon.Loggable;
   
   /**
    * A code-generation logicsheet. This class is actually a wrapper for
  @@ -51,13 +51,13 @@
    *
    * @author <a href="mailto:ricardo@apache.org">Ricardo Rocha</a>
    * @author <a href="mailto:dims@yahoo.com">Davanum Srinivas</a>
  - * @version CVS $Revision: 1.1.2.10 $ $Date: 2000/12/11 15:05:56 $
  + * @version CVS $Revision: 1.1.2.11 $ $Date: 2001/01/22 21:56:34 $
    */
  -public class Logicsheet {
  +public class Logicsheet implements Loggable {
       /**
        * The logger.
        */
  -    protected Logger log = LogKit.getLoggerFor("cocoon");
  +    protected Logger log;
   
       /**
       * The trax TransformerFactory
  @@ -67,6 +67,12 @@
       * The trax templates
       */
       protected Templates templates;
  +
  +    public void setLogger(Logger logger) {
  +        if (this.log == null) {
  +            this.log = logger;
  +        }
  +    }
   
       /**
       * The constructor. It does preserve the namespace from the stylesheet.
  
  
  
  1.1.2.11  +10 -4     xml-cocoon/src/org/apache/cocoon/components/language/markup/Attic/LogicsheetCodeGenerator.java
  
  Index: LogicsheetCodeGenerator.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/components/language/markup/Attic/LogicsheetCodeGenerator.java,v
  retrieving revision 1.1.2.10
  retrieving revision 1.1.2.11
  diff -u -r1.1.2.10 -r1.1.2.11
  --- LogicsheetCodeGenerator.java	2000/11/30 21:40:58	1.1.2.10
  +++ LogicsheetCodeGenerator.java	2001/01/22 21:56:34	1.1.2.11
  @@ -28,18 +28,18 @@
   import javax.xml.transform.TransformerException;
   
   import org.apache.log.Logger;
  -import org.apache.log.LogKit;
  +import org.apache.avalon.Loggable;
   
   /**
    * A logicsheet-based implementation of <code>MarkupCodeGenerator</code>
    *
    * @author <a href="mailto:ricardo@apache.org">Ricardo Rocha</a>
    * @author <a href="mailto:dims@yahoo.com">Davanum Srinivas</a>
  - * @version CVS $Revision: 1.1.2.10 $ $Date: 2000/11/30 21:40:58 $
  + * @version CVS $Revision: 1.1.2.11 $ $Date: 2001/01/22 21:56:34 $
    */
  -public class LogicsheetCodeGenerator implements MarkupCodeGenerator {
  +public class LogicsheetCodeGenerator implements MarkupCodeGenerator, Loggable {
   
  -    protected Logger log = LogKit.getLoggerFor("cocoon");
  +    protected Logger log;
   
       private Logicsheet corelogicsheet;
   
  @@ -74,6 +74,12 @@
               this.serializerContentHandler = this.serializer.asContentHandler();
           } catch (IOException ioe) {
               log.error("This should never happen, because we're not dealing with IO file, but rather with StringWriter", ioe);
  +        }
  +    }
  +
  +    public void setLogger(Logger logger) {
  +        if (this.log == null) {
  +            this.log = logger;
           }
       }
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.10  +28 -13    xml-cocoon/src/org/apache/cocoon/components/language/markup/sitemap/Attic/SitemapMarkupLanguage.java
  
  Index: SitemapMarkupLanguage.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/components/language/markup/sitemap/Attic/SitemapMarkupLanguage.java,v
  retrieving revision 1.1.2.9
  retrieving revision 1.1.2.10
  diff -u -r1.1.2.9 -r1.1.2.10
  --- SitemapMarkupLanguage.java	2001/01/12 15:31:23	1.1.2.9
  +++ SitemapMarkupLanguage.java	2001/01/22 21:56:35	1.1.2.10
  @@ -29,7 +29,7 @@
   import org.apache.cocoon.components.language.programming.ProgrammingLanguage;
   
   import org.apache.log.Logger;
  -import org.apache.log.LogKit;
  +import org.apache.avalon.Loggable;
   
   import java.io.IOException;
   import org.xml.sax.SAXException;
  @@ -39,9 +39,9 @@
    * <a href="http://xml.apache.org/cocoon/sitemap.html">Sitemap</a>.
    *
    * @author <a href="mailto:Giacomo.Pati@pwr.ch">Giacomo Pati</a>
  - * @version CVS $Revision: 1.1.2.9 $ $Date: 2001/01/12 15:31:23 $
  + * @version CVS $Revision: 1.1.2.10 $ $Date: 2001/01/22 21:56:35 $
    */
  -public class SitemapMarkupLanguage extends AbstractMarkupLanguage {
  +public class SitemapMarkupLanguage extends AbstractMarkupLanguage implements Loggable {
   
       /**
       * the dependencies' list
  @@ -101,9 +101,9 @@
   
       /**
       * Add a dependency on an external file to the document for inclusion in
  -    * generated code. This is used to populate a list of <code>File</code>'s 
  -	* tested for change on each invocation; this information is used to assert 
  -	* whether regeneration is necessary.
  +    * generated code. This is used to populate a list of <code>File</code>'s
  +    * tested for change on each invocation; this information is used to assert
  +    * whether regeneration is necessary.
       *
       * @param location The file path of the dependent file
       * @see <code>AbstractMarkupLanguage</code>, <code>ServerPagesGenerator</code>
  @@ -130,10 +130,13 @@
           LogicsheetCodeGenerator logicsheetMarkupGenerator,
           EntityResolver resolver
       ) {
  -        return new SitemapTransformerChainBuilderFilter(
  -            logicsheetMarkupGenerator,
  -            resolver
  -        );
  +        SitemapTransformerChainBuilderFilter filter =
  +            new SitemapTransformerChainBuilderFilter(
  +                logicsheetMarkupGenerator,
  +                resolver
  +             );
  +        filter.setLogger(this.log);
  +        return filter;
       }
   
   
  @@ -152,7 +155,7 @@
       *
       */
       protected class PreProcessFilter extends XMLFilterImpl {
  -        protected Logger log = LogKit.getLoggerFor("cocoon");
  +        protected Logger log;
   
           private String filename;
   
  @@ -171,6 +174,12 @@
           super.setParent(reader);
       }
   
  +  public void setLogger(Logger logger) {
  +      if (this.log == null) {
  +          this.log = logger;
  +      }
  +  }
  +
           public void startDocument() throws SAXException {
               super.startDocument();
               isRootElem = true;
  @@ -223,8 +232,8 @@
       * &lt;map:dependency;&gt;...&lt;/map:dependency;&gt;
       *
       */
  -    protected  class SitemapTransformerChainBuilderFilter extends TransformerChainBuilderFilter {
  -        protected Logger log = LogKit.getLoggerFor("cocoon");
  +    protected  class SitemapTransformerChainBuilderFilter extends TransformerChainBuilderFilter implements Loggable {
  +        protected Logger log;
   
           private Object[] rootElement;
   
  @@ -239,6 +248,12 @@
           private boolean insideRootElement;
   
           private boolean finished;
  +
  +  public void setLogger(Logger logger) {
  +      if (this.log == null) {
  +          this.log = logger;
  +      }
  +  }
   
           /**
            * default constructor
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.11  +10 -4     xml-cocoon/src/org/apache/cocoon/components/language/markup/xsp/Attic/XSPGenerator.java
  
  Index: XSPGenerator.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/components/language/markup/xsp/Attic/XSPGenerator.java,v
  retrieving revision 1.1.2.10
  retrieving revision 1.1.2.11
  diff -u -r1.1.2.10 -r1.1.2.11
  --- XSPGenerator.java	2000/11/10 22:38:54	1.1.2.10
  +++ XSPGenerator.java	2001/01/22 21:56:35	1.1.2.11
  @@ -13,7 +13,7 @@
   import org.apache.cocoon.components.parser.Parser;
   
   import org.apache.log.Logger;
  -import org.apache.log.LogKit;
  +import org.apache.avalon.Loggable;
   
   import org.apache.cocoon.generation.AbstractServerPage;
   
  @@ -21,12 +21,18 @@
    * Base class for XSP-generated <code>ServerPagesGenerator</code> classes
    *
    * @author <a href="mailto:ricardo@apache.org">Ricardo Rocha</a>
  - * @version CVS $Revision: 1.1.2.10 $ $Date: 2000/11/10 22:38:54 $
  + * @version CVS $Revision: 1.1.2.11 $ $Date: 2001/01/22 21:56:35 $
    */
  -public abstract class XSPGenerator extends AbstractServerPage {
  +public abstract class XSPGenerator extends AbstractServerPage implements Loggable {
   
     protected Parser parser;
  -  protected Logger log = LogKit.getLoggerFor("cocoon");
  +  protected Logger log;
  +
  +    public void setLogger(Logger logger) {
  +        if (this.log == null) {
  +            this.log = logger;
  +        }
  +    }
   
     /**
      * Set the current <code>ComponentManager</code> instance used by this
  
  
  
  1.1.2.9   +31 -11    xml-cocoon/src/org/apache/cocoon/components/language/markup/xsp/Attic/XSPMarkupLanguage.java
  
  Index: XSPMarkupLanguage.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/components/language/markup/xsp/Attic/XSPMarkupLanguage.java,v
  retrieving revision 1.1.2.8
  retrieving revision 1.1.2.9
  diff -u -r1.1.2.8 -r1.1.2.9
  --- XSPMarkupLanguage.java	2001/01/12 15:31:26	1.1.2.8
  +++ XSPMarkupLanguage.java	2001/01/22 21:56:35	1.1.2.9
  @@ -30,7 +30,7 @@
   import org.apache.cocoon.Constants;
   
   import org.apache.log.Logger;
  -import org.apache.log.LogKit;
  +import org.apache.avalon.Loggable;
   
   import java.io.IOException;
   import org.xml.sax.SAXException;
  @@ -41,10 +41,18 @@
    *
    * @author <a href="mailto:ricardo@apache.org">Ricardo Rocha</a>
    * @author <a href="mailto:ssahuc@apache.org">Sebastien Sahuc</a>
  - * @version CVS $Revision: 1.1.2.8 $ $Date: 2001/01/12 15:31:26 $
  + * @version CVS $Revision: 1.1.2.9 $ $Date: 2001/01/22 21:56:35 $
    */
  -public class XSPMarkupLanguage extends AbstractMarkupLanguage {
  +public class XSPMarkupLanguage extends AbstractMarkupLanguage implements Loggable {
  +    private Logger log;
   
  +    public void setLogger(Logger logger) {
  +        if (this.log == null) {
  +            this.log = logger;
  +        }
  +    }
  +
  +
       /**
       * store the dependencies.
       *
  @@ -105,10 +113,10 @@
   
       /**
       * Add a dependency on an external file to the document for inclusion in
  -    * generated code. This is used to populate a list of <code>File</code>'s 
  -	* tested for change on each invocation; this information is used to assert 
  -	* whether regeneration is necessary. XSP uses &lt;xsp:dependency&gt; 
  -	* elements for this purpose.
  +    * generated code. This is used to populate a list of <code>File</code>'s
  +    * tested for change on each invocation; this information is used to assert
  +    * whether regeneration is necessary. XSP uses &lt;xsp:dependency&gt;
  +    * elements for this purpose.
       *
       * @param location The file path of the dependent file
       * @see <code>AbstractMarkupLanguage</code>, <code>ServerPagesGenerator</code>
  @@ -184,8 +192,8 @@
       * programming language.
       *
       */
  -    protected class PreProcessFilter extends XMLFilterImpl {
  -        protected Logger log = LogKit.getLoggerFor("cocoon");
  +    protected class PreProcessFilter extends XMLFilterImpl implements Loggable {
  +        protected Logger log;
   
           private Stack stack;
   
  @@ -207,6 +215,12 @@
               this.language = language;
           }
   
  +    public void setLogger(Logger logger) {
  +        if (this.log == null) {
  +            this.log = logger;
  +        }
  +    }
  +
           /**
            * @see org.xml.sax.ContentHandler
            */
  @@ -302,9 +316,9 @@
       * &lt;xsp:dependency;&gt;...&lt;/xsp:dependency;&gt;
       *
       */
  -    protected  class XSPTransformerChainBuilderFilter extends TransformerChainBuilderFilter {
  +    protected  class XSPTransformerChainBuilderFilter extends TransformerChainBuilderFilter implements Loggable {
   
  -        protected Logger log = LogKit.getLoggerFor("cocoon");
  +        protected Logger log;
   
           private List startPrefix;
   
  @@ -330,6 +344,12 @@
           ) {
               super(logicsheetMarkupGenerator, resolver);
           }
  +
  +    public void setLogger(Logger logger) {
  +        if (this.log == null) {
  +            this.log = logger;
  +        }
  +    }
   
           /**
            * @see org.xml.sax.ContentHandler
  
  
  
  1.1.2.8   +3 -6      xml-cocoon/src/org/apache/cocoon/components/language/markup/xsp/Attic/XSPObjectHelper.java
  
  Index: XSPObjectHelper.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/components/language/markup/xsp/Attic/XSPObjectHelper.java,v
  retrieving revision 1.1.2.7
  retrieving revision 1.1.2.8
  diff -u -r1.1.2.7 -r1.1.2.8
  --- XSPObjectHelper.java	2001/01/03 15:38:02	1.1.2.7
  +++ XSPObjectHelper.java	2001/01/22 21:56:36	1.1.2.8
  @@ -16,9 +16,6 @@
   
   import org.w3c.dom.Node;
   
  -import org.apache.log.Logger;
  -import org.apache.log.LogKit;
  -
   import org.apache.cocoon.xml.XMLFragment;
   import org.apache.cocoon.xml.dom.DOMStreamer;
   
  @@ -28,7 +25,7 @@
    * @author <a href="mailto:ricardo@apache.org">Ricardo Rocha</a>
    * @author <a href="sylvain.wallez@anyware-tech.com">Sylvain Wallez</a>
    *         (Cocoon1 <code>xspExpr()</code> methods port)
  - * @version CVS $Revision: 1.1.2.7 $ $Date: 2001/01/03 15:38:02 $
  + * @version CVS $Revision: 1.1.2.8 $ $Date: 2001/01/22 21:56:36 $
    */
   public class XSPObjectHelper {
     /**
  @@ -165,7 +162,7 @@
     }
   
     // <xsp:expr> methods
  -  
  +
     /**
      * Implementation of &lt;xsp:expr&gt; for <code>char</code> :
      * outputs characters representing the value.
  @@ -311,7 +308,7 @@
         Iterator iterator = v.iterator();
         while (iterator.hasNext())
         {
  -      	xspExpr(contentHandler, iterator.next());
  +        xspExpr(contentHandler, iterator.next());
         }
       }
     }
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.35  +2 -2      xml-cocoon/src/org/apache/cocoon/components/language/markup/xsp/java/Attic/esql.xsl
  
  Index: esql.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/components/language/markup/xsp/java/Attic/esql.xsl,v
  retrieving revision 1.1.2.34
  retrieving revision 1.1.2.35
  diff -u -r1.1.2.34 -r1.1.2.35
  --- esql.xsl	2001/01/17 20:21:08	1.1.2.34
  +++ esql.xsl	2001/01/22 21:56:37	1.1.2.35
  @@ -1,5 +1,5 @@
   <?xml version="1.0"?>
  -<!-- $Id: esql.xsl,v 1.1.2.34 2001/01/17 20:21:08 balld Exp $-->
  +<!-- $Id: esql.xsl,v 1.1.2.35 2001/01/22 21:56:37 bloritsch Exp $-->
   <!--
   
    ============================================================================
  @@ -274,7 +274,7 @@
               _esql_connection.datasource = (DataSourceComponent) _esql_selector.select(String.valueOf(<xsl:copy-of select="$pool"/>));
               _esql_connection.connection = _esql_connection.datasource.getConnection();
             } catch (Exception _esql_exception_<xsl:value-of select="generate-id(.)"/>) {
  -            cocoonLogger.error("Could not get the datasource",_esql_exception_<xsl:value-of select="generate-id(.)"/>);
  +            log.error("Could not get the datasource",_esql_exception_<xsl:value-of select="generate-id(.)"/>);
               throw new RuntimeException("Could not get the datasource "+_esql_exception_<xsl:value-of select="generate-id(.)"/>);
             }
           </xsl:when>
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.10  +10 -4     xml-cocoon/src/org/apache/cocoon/components/language/programming/Attic/AbstractProgrammingLanguage.java
  
  Index: AbstractProgrammingLanguage.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/components/language/programming/Attic/AbstractProgrammingLanguage.java,v
  retrieving revision 1.1.2.9
  retrieving revision 1.1.2.10
  diff -u -r1.1.2.9 -r1.1.2.10
  --- AbstractProgrammingLanguage.java	2000/12/07 17:10:46	1.1.2.9
  +++ AbstractProgrammingLanguage.java	2001/01/22 21:56:37	1.1.2.10
  @@ -19,7 +19,7 @@
   import org.apache.cocoon.components.language.LanguageException;
   
   import org.apache.log.Logger;
  -import org.apache.log.LogKit;
  +import org.apache.avalon.Loggable;
   
   /**
    * Base implementation of <code>ProgrammingLanguage</code>. This class sets the
  @@ -27,17 +27,23 @@
    * unloading.
    *
    * @author <a href="mailto:ricardo@apache.org">Ricardo Rocha</a>
  - * @version CVS $Revision: 1.1.2.9 $ $Date: 2000/12/07 17:10:46 $
  + * @version CVS $Revision: 1.1.2.10 $ $Date: 2001/01/22 21:56:37 $
    */
   public abstract class AbstractProgrammingLanguage
  -  implements ProgrammingLanguage, Configurable
  +  implements ProgrammingLanguage, Configurable, Loggable
   {
  -  protected Logger log = LogKit.getLoggerFor("cocoon");
  +  protected Logger log;
   
     /** The source code formatter */
     protected Class codeFormatter;
   
     protected String languageName;
  +
  +    public void setLogger(Logger logger) {
  +        if (this.log == null) {
  +            this.log = logger;
  +        }
  +    }
   
     /**
      * Configure the language
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.10  +9 -4      xml-cocoon/src/org/apache/cocoon/components/language/programming/java/Attic/AbstractJavaCompiler.java
  
  Index: AbstractJavaCompiler.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/components/language/programming/java/Attic/AbstractJavaCompiler.java,v
  retrieving revision 1.1.2.9
  retrieving revision 1.1.2.10
  diff -u -r1.1.2.9 -r1.1.2.10
  --- AbstractJavaCompiler.java	2000/12/08 20:39:14	1.1.2.9
  +++ AbstractJavaCompiler.java	2001/01/22 21:56:38	1.1.2.10
  @@ -14,20 +14,19 @@
   
   import org.apache.cocoon.components.language.programming.*;
   
  -import org.apache.log.LogKit;
   import org.apache.log.Logger;
   
   /**
    * This class implements the functionality common to all Java compilers.
    * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
  - * @version $Revision: 1.1.2.9 $ $Date: 2000/12/08 20:39:14 $
  + * @version $Revision: 1.1.2.10 $ $Date: 2001/01/22 21:56:38 $
    * @since 2.0
    */
  -public abstract class AbstractJavaCompiler implements LanguageCompiler, Recyclable {
  +public abstract class AbstractJavaCompiler implements LanguageCompiler, Recyclable, Loggable {
     /**
      * The logger
      */
  -  protected Logger log = LogKit.getLoggerFor("cocoon");
  +  protected Logger log;
   
     /**
      * The source program filename
  @@ -87,6 +86,12 @@
     public void setDestination(String destDir) {
         this.destDir = destDir;
     }
  +
  +    public void setLogger(Logger logger) {
  +        if (this.log == null) {
  +            this.log = logger;
  +        }
  +    }
   
     /**
      * Set the classpath to be used for this compilation
  
  
  
  1.1.2.5   +10 -4     xml-cocoon/src/org/apache/cocoon/components/language/programming/java/Attic/JstyleFormatter.java
  
  Index: JstyleFormatter.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/components/language/programming/java/Attic/JstyleFormatter.java,v
  retrieving revision 1.1.2.4
  retrieving revision 1.1.2.5
  diff -u -r1.1.2.4 -r1.1.2.5
  --- JstyleFormatter.java	2000/12/08 20:39:20	1.1.2.4
  +++ JstyleFormatter.java	2001/01/22 21:56:39	1.1.2.5
  @@ -19,7 +19,7 @@
   import org.apache.cocoon.components.language.programming.*;
   
   import org.apache.log.Logger;
  -import org.apache.log.LogKit;
  +import org.apache.avalon.Loggable;
   
   /**
    * This class implements <code>CodeFormatter</code> based on
  @@ -27,10 +27,10 @@
    * beautifier. This implementation is very improvised...
    *
    * @author <a href="mailto:ricardo@apache.org">Ricardo Rocha</a>
  - * @version CVS $Revision: 1.1.2.4 $ $Date: 2000/12/08 20:39:20 $
  + * @version CVS $Revision: 1.1.2.5 $ $Date: 2001/01/22 21:56:39 $
    */
  -public class JstyleFormatter implements CodeFormatter {
  -  protected Logger log = LogKit.getLoggerFor("cocon");
  +public class JstyleFormatter implements CodeFormatter, Loggable {
  +  protected Logger log;
     /**
      * The default preferred line length. Should be parametrized!
      */
  @@ -44,6 +44,12 @@
      * The default space indentation. Should be parametrized!
      */
     protected static final int SPACE_INDENTATION = 2;
  +
  +    public void setLogger(Logger logger) {
  +        if (this.log == null) {
  +            this.log = logger;
  +        }
  +    }
   
     /**
      * Format and beautify a <code>String</code> containing source code.
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.8   +9 -3      xml-cocoon/src/org/apache/cocoon/components/store/Attic/FilesystemStore.java
  
  Index: FilesystemStore.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/components/store/Attic/FilesystemStore.java,v
  retrieving revision 1.1.2.7
  retrieving revision 1.1.2.8
  diff -u -r1.1.2.7 -r1.1.2.8
  --- FilesystemStore.java	2000/12/08 20:39:31	1.1.2.7
  +++ FilesystemStore.java	2001/01/22 21:56:39	1.1.2.8
  @@ -6,18 +6,18 @@
   import org.apache.cocoon.util.IOUtils;
   
   import org.apache.log.Logger;
  -import org.apache.log.LogKit;
  +import org.apache.avalon.Loggable;
   
   import org.apache.avalon.ThreadSafe;
   
   import java.io.IOException;
   
  -public class FilesystemStore implements Store, ThreadSafe {
  +public class FilesystemStore implements Store, ThreadSafe, Loggable {
     /** The directory repository */
     protected File directoryFile;
     protected volatile String directoryPath;
   
  -  private Logger log = LogKit.getLoggerFor("cocoon");
  +  private Logger log;
   
     /**
      * Constructor
  @@ -55,6 +55,12 @@
         );
       }
     }
  +
  +    public void setLogger(Logger logger) {
  +        if (this.log == null) {
  +            this.log = logger;
  +        }
  +    }
   
     /**
      * Returns the repository's full pathname
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.8   +9 -3      xml-cocoon/src/org/apache/cocoon/environment/Attic/AbstractEnvironment.java
  
  Index: AbstractEnvironment.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/environment/Attic/AbstractEnvironment.java,v
  retrieving revision 1.1.2.7
  retrieving revision 1.1.2.8
  diff -u -r1.1.2.7 -r1.1.2.8
  --- AbstractEnvironment.java	2000/12/30 21:33:10	1.1.2.7
  +++ AbstractEnvironment.java	2001/01/22 21:56:40	1.1.2.8
  @@ -23,14 +23,14 @@
   import org.apache.cocoon.environment.Environment;
   
   import org.apache.log.Logger;
  -import org.apache.log.LogKit;
  +import org.apache.avalon.Loggable;
   
   import org.xml.sax.InputSource;
   import org.xml.sax.SAXException;
   
  -public abstract class AbstractEnvironment implements Environment {
  +public abstract class AbstractEnvironment implements Environment, Loggable {
   
  -    protected Logger log = LogKit.getLoggerFor("cocoon");
  +    protected Logger log;
   
       /** The current uri in progress */
       protected String uri = null;
  @@ -84,6 +84,12 @@
           this.context = context.toURL();
           this.action = action;
           this.objectModel = new HashMap();
  +    }
  +
  +    public void setLogger(Logger logger) {
  +        if (this.log == null) {
  +            this.log = logger;
  +        }
       }
   
       // Sitemap methods
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.9   +10 -4     xml-cocoon/src/org/apache/cocoon/environment/commandline/Attic/FileSavingEnvironment.java
  
  Index: FileSavingEnvironment.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/environment/commandline/Attic/FileSavingEnvironment.java,v
  retrieving revision 1.1.2.8
  retrieving revision 1.1.2.9
  diff -u -r1.1.2.8 -r1.1.2.9
  --- FileSavingEnvironment.java	2000/12/30 21:36:46	1.1.2.8
  +++ FileSavingEnvironment.java	2001/01/22 21:56:41	1.1.2.9
  @@ -21,18 +21,18 @@
   import org.apache.cocoon.environment.AbstractEnvironment;
   
   import org.apache.log.Logger;
  -import org.apache.log.LogKit;
  +import org.apache.avalon.Loggable;
   
   /**
    * This environment is used to save the requested file to disk.
    *
    * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
  - * @version CVS $Revision: 1.1.2.8 $ $Date: 2000/12/30 21:36:46 $
  + * @version CVS $Revision: 1.1.2.9 $ $Date: 2001/01/22 21:56:41 $
    */
   
  -public class FileSavingEnvironment extends AbstractCommandLineEnvironment {
  +public class FileSavingEnvironment extends AbstractCommandLineEnvironment implements Loggable {
   
  -    private Logger log = LogKit.getLoggerFor("cocoon");
  +    private Logger log;
   
       public FileSavingEnvironment(String uri, File context, Map attributes, Map parameters, Map links, OutputStream stream)
       throws MalformedURLException {
  @@ -42,6 +42,12 @@
           this.objectModel.put(Cocoon.REQUEST_OBJECT, new CommandLineRequest(null, uri, null, attributes, parameters));
           this.objectModel.put(Cocoon.RESPONSE_OBJECT, new CommandLineResponse());
       }
  +    public void setLogger(Logger logger) {
  +        if (this.log == null) {
  +            this.log = logger;
  +        }
  +    }
  +
   }
   
   
  
  
  
  1.1.2.9   +11 -5     xml-cocoon/src/org/apache/cocoon/environment/commandline/Attic/LinkSamplingEnvironment.java
  
  Index: LinkSamplingEnvironment.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/environment/commandline/Attic/LinkSamplingEnvironment.java,v
  retrieving revision 1.1.2.8
  retrieving revision 1.1.2.9
  diff -u -r1.1.2.8 -r1.1.2.9
  --- LinkSamplingEnvironment.java	2000/12/30 21:36:46	1.1.2.8
  +++ LinkSamplingEnvironment.java	2001/01/22 21:56:42	1.1.2.9
  @@ -5,7 +5,7 @@
    * version 1.1, a copy of which has been included  with this distribution in *
    * the LICENSE file.                                                         *
    *****************************************************************************/
  - 
  +
   package org.apache.cocoon.environment.commandline;
   
   import java.util.Iterator;
  @@ -30,19 +30,19 @@
   import org.apache.cocoon.environment.AbstractEnvironment;
   
   import org.apache.log.Logger;
  -import org.apache.log.LogKit;
  +import org.apache.avalon.Loggable;
   
   
   /**
    * This environment is sample the links of the resource.
    *
    * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
  - * @version CVS $Revision: 1.1.2.8 $ $Date: 2000/12/30 21:36:46 $
  + * @version CVS $Revision: 1.1.2.9 $ $Date: 2001/01/22 21:56:42 $
    */
   
  -public class LinkSamplingEnvironment extends AbstractCommandLineEnvironment {
  +public class LinkSamplingEnvironment extends AbstractCommandLineEnvironment implements Loggable {
   
  -    private Logger log = LogKit.getLoggerFor("cocoon");
  +    private Logger log;
   
       private boolean skip = false;
   
  @@ -52,6 +52,12 @@
           log.debug("LinkSamplingEnvironment: uri=" + uri);
           this.objectModel.put(Cocoon.REQUEST_OBJECT, new CommandLineRequest(null, uri, null, attributes, parameters));
           this.objectModel.put(Cocoon.RESPONSE_OBJECT, new CommandLineResponse());
  +    }
  +
  +    public void setLogger(Logger logger) {
  +        if (this.log == null) {
  +            this.log = logger;
  +        }
       }
   
       /**
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.11  +6 -1      xml-cocoon/src/org/apache/cocoon/generation/Attic/ServerPagesGenerator.java
  
  Index: ServerPagesGenerator.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/generation/Attic/ServerPagesGenerator.java,v
  retrieving revision 1.1.2.10
  retrieving revision 1.1.2.11
  diff -u -r1.1.2.10 -r1.1.2.11
  --- ServerPagesGenerator.java	2000/12/08 20:39:39	1.1.2.10
  +++ ServerPagesGenerator.java	2001/01/22 21:56:43	1.1.2.11
  @@ -30,13 +30,14 @@
   import java.net.MalformedURLException;
   import org.apache.cocoon.ProcessingException;
   import org.apache.cocoon.Roles;
  +import org.apache.avalon.Loggable;
   
   /**
    * This class acts as a proxy to a dynamically loaded<code>Generator</code>
    * delegating actual SAX event generation.
    *
    * @author <a href="mailto:ricardo@apache.org">Ricardo Rocha</a>
  - * @version CVS $Revision: 1.1.2.10 $ $Date: 2000/12/08 20:39:39 $
  + * @version CVS $Revision: 1.1.2.11 $ $Date: 2001/01/22 21:56:43 $
    */
   public class ServerPagesGenerator
     extends ServletGenerator
  @@ -130,6 +131,10 @@
       } catch (Exception e) {
         log.warn("ServerPagesGenerator.generate()", e);
         throw new ProcessingException(e.getMessage());
  +    }
  +
  +    if (generator instanceof Loggable) {
  +        ((Loggable)generator).setLogger(this.log);
       }
   
       // Delegate XML production to loaded generator
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.6   +10 -4     xml-cocoon/src/org/apache/cocoon/matching/Attic/RegexpTargetHostMatcherFactory.java
  
  Index: RegexpTargetHostMatcherFactory.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/matching/Attic/RegexpTargetHostMatcherFactory.java,v
  retrieving revision 1.1.2.5
  retrieving revision 1.1.2.6
  diff -u -r1.1.2.5 -r1.1.2.6
  --- RegexpTargetHostMatcherFactory.java	2000/12/15 20:41:15	1.1.2.5
  +++ RegexpTargetHostMatcherFactory.java	2001/01/22 21:56:45	1.1.2.6
  @@ -17,7 +17,7 @@
   
   import org.w3c.dom.traversal.NodeIterator;
   
  -import org.apache.log.LogKit;
  +import org.apache.avalon.Loggable;
   import org.apache.log.Logger;
   
   /**
  @@ -27,15 +27,21 @@
    * @author <a href="mailto:Giacomo.Pati@pwr.ch">Giacomo Pati</a>
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
    * @author <a href="mailto:paul@luminas.co.uk">Paul Russell</a>
  - * @version CVS $Revision: 1.1.2.5 $ $Date: 2000/12/15 20:41:15 $
  + * @version CVS $Revision: 1.1.2.6 $ $Date: 2001/01/22 21:56:45 $
    */
   
  -public class RegexpTargetHostMatcherFactory implements CodeFactory {
  -    protected Logger log = LogKit.getLoggerFor("cocoon");
  +public class RegexpTargetHostMatcherFactory implements CodeFactory, Loggable {
  +    protected Logger log;
   
       public String generateParameterSource (NodeIterator conf)
       throws ConfigurationException {
           return "RE";
  +    }
  +
  +    public void setLogger(Logger logger) {
  +        if (this.log == null) {
  +            this.log = logger;
  +        }
       }
   
       public String generateClassSource (String prefix, String pattern,
  
  
  
  1.1.2.19  +10 -4     xml-cocoon/src/org/apache/cocoon/matching/Attic/RegexpURIMatcherFactory.java
  
  Index: RegexpURIMatcherFactory.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/matching/Attic/RegexpURIMatcherFactory.java,v
  retrieving revision 1.1.2.18
  retrieving revision 1.1.2.19
  diff -u -r1.1.2.18 -r1.1.2.19
  --- RegexpURIMatcherFactory.java	2000/12/15 20:35:12	1.1.2.18
  +++ RegexpURIMatcherFactory.java	2001/01/22 21:56:46	1.1.2.19
  @@ -18,7 +18,7 @@
   import org.w3c.dom.traversal.NodeIterator;
   
   import org.apache.log.Logger;
  -import org.apache.log.LogKit;
  +import org.apache.avalon.Loggable;
   
   /**
    * This class generates source code which represents a specific pattern matcher
  @@ -26,15 +26,21 @@
    *
    * @author <a href="mailto:Giacomo.Pati@pwr.ch">Giacomo Pati</a>
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
  - * @version CVS $Revision: 1.1.2.18 $ $Date: 2000/12/15 20:35:12 $
  + * @version CVS $Revision: 1.1.2.19 $ $Date: 2001/01/22 21:56:46 $
    */
   
  -public class RegexpURIMatcherFactory implements CodeFactory {
  -    protected Logger log = LogKit.getLoggerFor("cocoon");
  +public class RegexpURIMatcherFactory implements CodeFactory, Loggable {
  +    protected Logger log;
   
       public String generateParameterSource (NodeIterator conf)
       throws ConfigurationException {
           return "RE";
  +    }
  +
  +    public void setLogger(Logger logger) {
  +        if (this.log == null) {
  +            this.log = logger;
  +        }
       }
   
       public String generateClassSource (String prefix, String pattern,
  
  
  
  1.1.2.26  +10 -4     xml-cocoon/src/org/apache/cocoon/matching/Attic/WildcardURIMatcherFactory.java
  
  Index: WildcardURIMatcherFactory.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/matching/Attic/WildcardURIMatcherFactory.java,v
  retrieving revision 1.1.2.25
  retrieving revision 1.1.2.26
  diff -u -r1.1.2.25 -r1.1.2.26
  --- WildcardURIMatcherFactory.java	2000/12/15 20:44:35	1.1.2.25
  +++ WildcardURIMatcherFactory.java	2001/01/22 21:56:46	1.1.2.26
  @@ -15,7 +15,7 @@
   import org.w3c.dom.traversal.NodeIterator;
   
   import org.apache.log.Logger;
  -import org.apache.log.LogKit;
  +import org.apache.avalon.Loggable;
   
   /**
    * This class generates source code which represents a specific pattern matcher
  @@ -24,11 +24,11 @@
    * @author <a href="mailto:Giacomo.Pati@pwr.ch">Giacomo Pati</a>
    * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
  - * @version CVS $Revision: 1.1.2.25 $ $Date: 2000/12/15 20:44:35 $
  + * @version CVS $Revision: 1.1.2.26 $ $Date: 2001/01/22 21:56:46 $
    */
   
  -public class WildcardURIMatcherFactory implements CodeFactory {
  -    protected Logger log = LogKit.getLoggerFor("cocoon");
  +public class WildcardURIMatcherFactory implements CodeFactory, Loggable {
  +    protected Logger log;
   
       /** The int representing '*' in the pattern <code>int []</code>. */
       protected static final int MATCH_FILE	= -1;
  @@ -50,6 +50,12 @@
       public String generateParameterSource (NodeIterator conf)
       throws ConfigurationException {
           return "int []";
  +    }
  +
  +    public void setLogger(Logger logger) {
  +        if (this.log == null) {
  +            this.log = logger;
  +        }
       }
   
       /**
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.7   +10 -4     xml-cocoon/src/org/apache/cocoon/reading/Attic/AbstractReader.java
  
  Index: AbstractReader.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/reading/Attic/AbstractReader.java,v
  retrieving revision 1.1.2.6
  retrieving revision 1.1.2.7
  diff -u -r1.1.2.6 -r1.1.2.7
  --- AbstractReader.java	2000/12/08 20:39:58	1.1.2.6
  +++ AbstractReader.java	2001/01/22 21:56:47	1.1.2.7
  @@ -15,16 +15,16 @@
   import org.xml.sax.EntityResolver;
   
   import org.apache.log.Logger;
  -import org.apache.log.LogKit;
  +import org.apache.avalon.Loggable;
   
   /**
    *
    * @author <a href="mailto:Giacomo.Pati@pwr.ch">Giacomo Pati</a>
  - * @version CVS $Revision: 1.1.2.6 $ $Date: 2000/12/08 20:39:58 $
  + * @version CVS $Revision: 1.1.2.7 $ $Date: 2001/01/22 21:56:47 $
    */
  -public abstract class AbstractReader implements Reader {
  +public abstract class AbstractReader implements Reader, Loggable {
       /** The logger */
  -    protected Logger log = LogKit.getLoggerFor("cocoon");
  +    protected Logger log;
       /** The current <code>EntityResolver</code>. */
       protected EntityResolver resolver=null;
       /** The current <code>Map</code> of the object model. */
  @@ -45,6 +45,12 @@
           this.objectModel=objectModel;
           this.source=src;
           this.parameters=par;
  +    }
  +
  +    public void setLogger(Logger logger) {
  +        if (this.log == null) {
  +            this.log = logger;
  +        }
       }
   
       /**
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.4.44  +3 -1      xml-cocoon/src/org/apache/cocoon/servlet/Attic/CocoonServlet.java
  
  Index: CocoonServlet.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/servlet/Attic/CocoonServlet.java,v
  retrieving revision 1.1.4.43
  retrieving revision 1.1.4.44
  diff -u -r1.1.4.43 -r1.1.4.44
  --- CocoonServlet.java	2001/01/08 15:29:39	1.1.4.43
  +++ CocoonServlet.java	2001/01/22 21:56:47	1.1.4.44
  @@ -53,7 +53,7 @@
    * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
    * @author <a href="mailto:nicolaken@supereva.it">Nicola Ken Barozzi</a> Aisa
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
  - * @version CVS $Revision: 1.1.4.43 $ $Date: 2001/01/08 15:29:39 $
  + * @version CVS $Revision: 1.1.4.44 $ $Date: 2001/01/22 21:56:47 $
    */
   
   public class CocoonServlet extends HttpServlet {
  @@ -398,6 +398,8 @@
           try {
               log.info("Reloading from: " + this.configFile.toExternalForm());
               Cocoon c = new Cocoon(this.configFile, this.classpath, this.workDir, this.root);
  +            c.setLogger(this.log);
  +            c.init();
               this.creationTime = new Date().getTime();
               this.cocoon = c;
           } catch (Exception e) {
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.18  +11 -5     xml-cocoon/src/org/apache/cocoon/sitemap/Attic/AbstractSitemap.java
  
  Index: AbstractSitemap.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/sitemap/Attic/AbstractSitemap.java,v
  retrieving revision 1.1.2.17
  retrieving revision 1.1.2.18
  diff -u -r1.1.2.17 -r1.1.2.18
  --- AbstractSitemap.java	2001/01/12 09:50:40	1.1.2.17
  +++ AbstractSitemap.java	2001/01/22 21:56:48	1.1.2.18
  @@ -26,7 +26,7 @@
   import org.apache.cocoon.sitemap.ComponentHolderFactory;
   import org.apache.cocoon.util.ClassUtils;
   
  -import org.apache.log.LogKit;
  +import org.apache.avalon.Loggable;
   import org.apache.log.Logger;
   
   import org.xml.sax.SAXException;
  @@ -35,10 +35,10 @@
    * Base class for generated <code>Sitemap</code> classes
    *
    * @author <a href="mailto:Giacomo.Pati@pwr.ch">Giacomo Pati</a>
  - * @version CVS $Revision: 1.1.2.17 $ $Date: 2001/01/12 09:50:40 $
  + * @version CVS $Revision: 1.1.2.18 $ $Date: 2001/01/22 21:56:48 $
    */
  -public abstract class AbstractSitemap implements Sitemap {
  -    protected Logger log = LogKit.getLoggerFor("cocoon");
  +public abstract class AbstractSitemap implements Sitemap, Loggable {
  +    protected Logger log;
   
       /** The component manager instance */
       protected ComponentManager manager;
  @@ -60,6 +60,12 @@
           this.sitemapComponentManager = new DefaultComponentManager (parentSitemapComponentManager);
       }
   
  +    public void setLogger(Logger logger) {
  +        if (this.log == null) {
  +            this.log = logger;
  +        }
  +    }
  +
       /**
        * Set the current <code>ComponentManager</code> instance used by this
        * <code>Composer</code>.
  @@ -102,7 +108,7 @@
           }
           this.sitemapComponentManager.put(
               type, ComponentHolderFactory.getComponentHolder(
  -                classURL, configuration, this.manager, mime_type
  +                this.log, classURL, configuration, this.manager, mime_type
               )
           );
       }
  
  
  
  1.1.2.5   +9 -8      xml-cocoon/src/org/apache/cocoon/sitemap/Attic/ComponentHolderFactory.java
  
  Index: ComponentHolderFactory.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/sitemap/Attic/ComponentHolderFactory.java,v
  retrieving revision 1.1.2.4
  retrieving revision 1.1.2.5
  diff -u -r1.1.2.4 -r1.1.2.5
  --- ComponentHolderFactory.java	2000/10/13 04:14:42	1.1.2.4
  +++ ComponentHolderFactory.java	2001/01/22 21:56:48	1.1.2.5
  @@ -14,6 +14,7 @@
   import org.apache.avalon.Poolable;
   import org.apache.avalon.ThreadSafe;
   import org.apache.avalon.SingleThreaded;
  +import org.apache.log.Logger;
   
   import org.apache.cocoon.util.ClassUtils;
   /**
  @@ -21,25 +22,25 @@
    * interfaces the passed component implements.
    *
    * @author <a href="mailto:Giacomo.Pati@pwr.ch">Giacomo Pati</a>
  - * @version CVS $Revision: 1.1.2.4 $ $Date: 2000/10/13 04:14:42 $
  + * @version CVS $Revision: 1.1.2.5 $ $Date: 2001/01/22 21:56:48 $
    */
   public class ComponentHolderFactory {
   
  -    public static ComponentHolder getComponentHolder (String componentName, Configuration configuration, ComponentManager manager)
  +    public static ComponentHolder getComponentHolder (Logger logger, String componentName, Configuration configuration, ComponentManager manager)
       throws Exception {
  -        return (getComponentHolder(componentName, configuration, manager, null));
  +        return (getComponentHolder(logger, componentName, configuration, manager, null));
       }
   
  -    public static ComponentHolder getComponentHolder (String componentName, Configuration configuration, ComponentManager manager, String mime_type)
  +    public static ComponentHolder getComponentHolder (Logger logger, String componentName, Configuration configuration, ComponentManager manager, String mime_type)
       throws Exception {
           if (ClassUtils.implementsInterface (componentName, Poolable.class.getName())) {
  -            return new PoolableComponentHolder (componentName, configuration, manager, mime_type);
  +            return new PoolableComponentHolder (logger, componentName, configuration, manager, mime_type);
           } else if (ClassUtils.implementsInterface (componentName, SingleThreaded.class.getName())) {
  -            return new DefaultComponentHolder (componentName, configuration, manager, mime_type);
  +            return new DefaultComponentHolder (logger, componentName, configuration, manager, mime_type);
           } else if (ClassUtils.implementsInterface (componentName, ThreadSafe.class.getName())) {
  -            return new ThreadSafeComponentHolder (componentName, configuration, manager, mime_type);
  +            return new ThreadSafeComponentHolder (logger, componentName, configuration, manager, mime_type);
           } else  {
  -            return new DefaultComponentHolder (componentName, configuration, manager, mime_type);
  +            return new DefaultComponentHolder (logger, componentName, configuration, manager, mime_type);
           }
       }
   }
  
  
  
  1.1.2.5   +8 -4      xml-cocoon/src/org/apache/cocoon/sitemap/Attic/DefaultComponentHolder.java
  
  Index: DefaultComponentHolder.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/sitemap/Attic/DefaultComponentHolder.java,v
  retrieving revision 1.1.2.4
  retrieving revision 1.1.2.5
  diff -u -r1.1.2.4 -r1.1.2.5
  --- DefaultComponentHolder.java	2000/12/08 20:40:31	1.1.2.4
  +++ DefaultComponentHolder.java	2001/01/22 21:56:48	1.1.2.5
  @@ -13,21 +13,21 @@
   import org.apache.avalon.Composer;
   import org.apache.avalon.Configuration;
   import org.apache.avalon.Configurable;
  +import org.apache.avalon.Loggable;
   
   import org.apache.cocoon.util.ClassUtils;
   
   import org.apache.log.Logger;
  -import org.apache.log.LogKit;
   
   /**
    * This class holds a sitemap component which is not specially marked as having
    * a spezial behaviour or treatment.
    *
    * @author <a href="mailto:Giacomo.Pati@pwr.ch">Giacomo Pati</a>
  - * @version CVS $Revision: 1.1.2.4 $ $Date: 2000/12/08 20:40:31 $
  + * @version CVS $Revision: 1.1.2.5 $ $Date: 2001/01/22 21:56:48 $
    */
   public class DefaultComponentHolder implements ComponentHolder {
  -    protected Logger log = LogKit.getLoggerFor("cocoon");
  +    protected Logger log;
   
       protected String className;
       protected Configuration configuration;
  @@ -39,7 +39,8 @@
        * @param configuration The </CODE>Configuration</CODE> for the component
        * @param manager A <CODE>ComponentManager</CODE> for the component
        */
  -    public DefaultComponentHolder(String className, Configuration configuration, ComponentManager manager, String mime_type) {
  +    public DefaultComponentHolder(Logger log, String className, Configuration configuration, ComponentManager manager, String mime_type) {
  +        this.log = log;
           this.className = className;
           this.configuration = configuration;
           this.manager = manager;
  @@ -51,6 +52,9 @@
        */
       public Component get() throws Exception {
           Component comp = (Component) ClassUtils.newInstance (this.className);
  +        if (comp instanceof Loggable) {
  +            ((Loggable) comp).setLogger(this.log);
  +        }
           if (comp instanceof Composer) {
               ((Composer) comp).compose (this.manager);
           }
  
  
  
  1.1.2.11  +15 -8     xml-cocoon/src/org/apache/cocoon/sitemap/Attic/Handler.java
  
  Index: Handler.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/sitemap/Attic/Handler.java,v
  retrieving revision 1.1.2.10
  retrieving revision 1.1.2.11
  diff -u -r1.1.2.10 -r1.1.2.11
  --- Handler.java	2000/12/21 09:05:41	1.1.2.10
  +++ Handler.java	2001/01/22 21:56:48	1.1.2.11
  @@ -28,17 +28,17 @@
   import org.apache.avalon.ComponentManager;
   
   import org.apache.log.Logger;
  -import org.apache.log.LogKit;
  +import org.apache.avalon.Loggable;
   
   /**
    * Handles the manageing and stating of one <code>Sitemap</code>
    *
    * @author <a href="mailto:Giacomo.Pati@pwr.ch">Giacomo Pati</a>
    * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
  - * @version CVS $Revision: 1.1.2.10 $ $Date: 2000/12/21 09:05:41 $
  + * @version CVS $Revision: 1.1.2.11 $ $Date: 2001/01/22 21:56:48 $
    */
  -public class Handler implements Runnable, Configurable, Composer, Processor {
  -    protected Logger log = LogKit.getLoggerFor("cocoon");
  +public class Handler implements Runnable, Configurable, Composer, Processor, Loggable {
  +    protected Logger log;
   
       /** the configuration */
       private Configuration conf;
  @@ -76,6 +76,12 @@
           this.conf = conf;
       }
   
  +    public void setLogger(Logger logger) {
  +        if (this.log == null) {
  +            this.log = logger;
  +        }
  +    }
  +
       protected Handler (ComponentManager sitemapComponentManager, String source, boolean check_reload)
       throws FileNotFoundException {
           this.parentSitemapComponentManager = sitemapComponentManager;
  @@ -125,11 +131,11 @@
   
       protected synchronized void regenerate (Environment environment)
       throws Exception {
  -		log.debug("Beginning sitemap regeneration");
  +        log.debug("Beginning sitemap regeneration");
           regenerateAsynchronously(environment);
           if (regeneration != null)
               regeneration.join();
  -		log.debug("Sitemap regeneration complete");
  +        log.debug("Sitemap regeneration complete");
       }
   
       public boolean process (Environment environment)
  @@ -161,6 +167,7 @@
               ProgramGenerator programGenerator = (ProgramGenerator) this.manager.lookup(Roles.PROGRAM_GENERATOR);
               smap = (Sitemap) programGenerator.load(file, markupLanguage, programmingLanguage, environment);
               smap.setParentSitemapComponentManager (this.parentSitemapComponentManager);
  +            if (smap instanceof Loggable) ((Loggable) smap).setLogger(this.log);
               if (smap instanceof Composer) smap.compose(this.manager);
               if (smap instanceof Configurable) smap.configure(this.conf);
               this.sitemap = smap;
  @@ -172,8 +179,8 @@
           } catch (Exception e) {
               log.error("Error compiling sitemap", e);
               this.exception = e;
  -		} catch (Throwable t) {
  -			log.error("Error compiling sitemap", t);
  +        } catch (Throwable t) {
  +            log.error("Error compiling sitemap", t);
           } finally {
               this.regeneration = null;
               this.environment = null;
  
  
  
  1.1.2.5   +14 -4     xml-cocoon/src/org/apache/cocoon/sitemap/Attic/Manager.java
  
  Index: Manager.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/sitemap/Attic/Manager.java,v
  retrieving revision 1.1.2.4
  retrieving revision 1.1.2.5
  diff -u -r1.1.2.4 -r1.1.2.5
  --- Manager.java	2000/11/30 21:42:24	1.1.2.4
  +++ Manager.java	2001/01/22 21:56:49	1.1.2.5
  @@ -19,6 +19,8 @@
   import org.apache.avalon.Composer;
   import org.apache.avalon.Configurable;
   import org.apache.avalon.Configuration;
  +import org.apache.avalon.Loggable;
  +import org.apache.log.Logger;
   
   import org.apache.cocoon.ProcessingException;
   import org.apache.cocoon.environment.Environment;
  @@ -32,9 +34,10 @@
    * checking regeneration of the sub <code>Sitemap</code>
    *
    * @author <a href="mailto:Giacomo.Pati@pwr.ch">Giacomo Pati</a>
  - * @version CVS $Revision: 1.1.2.4 $ $Date: 2000/11/30 21:42:24 $
  + * @version CVS $Revision: 1.1.2.5 $ $Date: 2001/01/22 21:56:49 $
    */
  -public class Manager implements Configurable, Composer {
  +public class Manager implements Configurable, Composer, Loggable {
  +    private Logger log;
   
       /** The vectors of sub sitemaps */
       private HashMap sitemaps = new HashMap();
  @@ -52,6 +55,12 @@
           this.parentSitemapComponentManager = sitemapComponentManager;
       }
   
  +    public void setLogger (Logger logger) {
  +        if (this.log == null) {
  +            this.log = logger;
  +        }
  +    }
  +
       public void configure (Configuration conf) {
           this.conf = conf;
       }
  @@ -77,8 +86,9 @@
               }
           } else {
               sitemapHandler = new Handler(parentSitemapComponentManager, source, check_reload);
  -            if (sitemapHandler instanceof Composer) sitemapHandler.compose(this.manager);
  -            if (sitemapHandler instanceof Configurable) sitemapHandler.configure(this.conf);
  +            sitemapHandler.setLogger(this.log);
  +            sitemapHandler.compose(this.manager);
  +            sitemapHandler.configure(this.conf);
               sitemaps.put(source, sitemapHandler);
               sitemapHandler.regenerate(environment);
           }
  
  
  
  1.1.2.5   +8 -4      xml-cocoon/src/org/apache/cocoon/sitemap/Attic/PoolableComponentHolder.java
  
  Index: PoolableComponentHolder.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/sitemap/Attic/PoolableComponentHolder.java,v
  retrieving revision 1.1.2.4
  retrieving revision 1.1.2.5
  diff -u -r1.1.2.4 -r1.1.2.5
  --- PoolableComponentHolder.java	2000/12/08 20:40:32	1.1.2.4
  +++ PoolableComponentHolder.java	2001/01/22 21:56:49	1.1.2.5
  @@ -17,6 +17,7 @@
   import org.apache.avalon.util.pool.ObjectFactory;
   import org.apache.avalon.util.pool.Pool;
   import org.apache.avalon.util.pool.PoolController;
  +import org.apache.log.Logger;
   
   import org.apache.cocoon.util.ClassUtils;
   import org.apache.cocoon.util.ComponentPool;
  @@ -27,7 +28,7 @@
    * a spezial behaviour or treatment.
    *
    * @author <a href="mailto:Giacomo.Pati@pwr.ch">Giacomo Pati</a>
  - * @version CVS $Revision: 1.1.2.4 $ $Date: 2000/12/08 20:40:32 $
  + * @version CVS $Revision: 1.1.2.5 $ $Date: 2001/01/22 21:56:49 $
    */
   public class PoolableComponentHolder extends DefaultComponentHolder implements ObjectFactory {
   
  @@ -48,9 +49,9 @@
        * @param configuration The </CODE>Configuration</CODE> for the component
        * @param manager A <CODE>ComponentManager</CODE> for the component
        */
  -    public PoolableComponentHolder(String className, Configuration configuration, ComponentManager manager, String mime_type)
  +    public PoolableComponentHolder(Logger log, String className, Configuration configuration, ComponentManager manager, String mime_type)
       throws Exception {
  -        super(className, configuration, manager, mime_type);
  +        super(log, className, configuration, manager, mime_type);
           try {
               this.clazz = ClassUtils.loadClass (super.className);
           } catch (Exception e) {
  @@ -58,7 +59,10 @@
               this.clazz = null;
           }
           PoolController pc = (PoolController)super.manager.lookup (Roles.POOL_CONTROLLER);
  -        this.pool = new ComponentPool (this, pc, amount, DEFAULT_AMOUNT);
  +        ComponentPool cp = new ComponentPool (this, pc, amount, DEFAULT_AMOUNT);
  +        cp.setLogger(this.log);
  +        cp.init();
  +        this.pool = cp;
       }
   
       /** Creates a new instance of the <CODE>Component</CODE>
  
  
  
  1.1.2.3   +5 -4      xml-cocoon/src/org/apache/cocoon/sitemap/Attic/ThreadSafeComponentHolder.java
  
  Index: ThreadSafeComponentHolder.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/sitemap/Attic/ThreadSafeComponentHolder.java,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- ThreadSafeComponentHolder.java	2000/10/13 04:14:43	1.1.2.2
  +++ ThreadSafeComponentHolder.java	2001/01/22 21:56:49	1.1.2.3
  @@ -13,14 +13,15 @@
   import org.apache.avalon.Composer;
   import org.apache.avalon.Configuration;
   import org.apache.avalon.Configurable;
  +import org.apache.log.Logger;
   
   import org.apache.cocoon.util.ClassUtils;
   
  -/** 
  +/**
    * This class holds a sitemap component which is specially marked as beeing thread safe
    *
    * @author <a href="mailto:Giacomo.Pati@pwr.ch">Giacomo Pati</a>
  - * @version CVS $Revision: 1.1.2.2 $ $Date: 2000/10/13 04:14:43 $
  + * @version CVS $Revision: 1.1.2.3 $ $Date: 2001/01/22 21:56:49 $
    */
   public class ThreadSafeComponentHolder extends DefaultComponentHolder {
   
  @@ -31,9 +32,9 @@
        * @param configuration The </CODE>Configuration</CODE> for the component
        * @param manager A <CODE>ComponentManager</CODE> for the component
        */
  -    public ThreadSafeComponentHolder(String className, Configuration configuration, ComponentManager manager, String mime_type)
  +    public ThreadSafeComponentHolder(Logger log, String className, Configuration configuration, ComponentManager manager, String mime_type)
       throws Exception {
  -        super(className, configuration, manager, mime_type);
  +        super(log, className, configuration, manager, mime_type);
           this.comp = super.get();
       }
   
  
  
  
  1.1.2.8   +19 -4     xml-cocoon/src/org/apache/cocoon/sitemap/Attic/XSLTFactoryLoader.java
  
  Index: XSLTFactoryLoader.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/sitemap/Attic/XSLTFactoryLoader.java,v
  retrieving revision 1.1.2.7
  retrieving revision 1.1.2.8
  diff -u -r1.1.2.7 -r1.1.2.8
  --- XSLTFactoryLoader.java	2000/12/11 15:06:07	1.1.2.7
  +++ XSLTFactoryLoader.java	2001/01/22 21:56:49	1.1.2.8
  @@ -16,7 +16,7 @@
   import org.w3c.dom.traversal.NodeIterator;
   
   import org.apache.log.Logger;
  -import org.apache.log.LogKit;
  +import org.apache.avalon.Loggable;
   
   /**
    * This class is used as a XSLT extension class. It is used by the sitemap
  @@ -25,11 +25,11 @@
    *
    * @author <a href="mailto:Giacomo.Pati@pwr.ch">Giacomo Pati</a>
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
  - * @version CVS $Revision: 1.1.2.7 $ $Date: 2000/12/11 15:06:07 $
  + * @version CVS $Revision: 1.1.2.8 $ $Date: 2001/01/22 21:56:49 $
    */
   
  -public class XSLTFactoryLoader {
  -    protected Logger log = LogKit.getLoggerFor("cocoon");
  +public class XSLTFactoryLoader implements Loggable {
  +    protected Logger log;
   
       private HashMap obj = new HashMap();
   
  @@ -39,6 +39,9 @@
           if (factory == null) factory = ClassUtils.newInstance(className);
           obj.put(className, factory);
   
  +        if (factory instanceof Loggable) {
  +            ((Loggable)factory).setLogger(this.log);
  +        }
           if (factory instanceof CodeFactory) {
               return ((CodeFactory) factory).generateClassSource(prefix, pattern, conf);
           }
  @@ -47,12 +50,21 @@
                               + "\". Should implement the CodeFactory interface");
       }
   
  +    public void setLogger(Logger logger) {
  +        if (this.log == null) {
  +            this.log = logger;
  +        }
  +    }
  +
       public String getParameterSource(String className, NodeIterator conf)
       throws ClassNotFoundException, InstantiationException, IllegalAccessException, Exception {
           Object factory = obj.get(className);
       if (factory == null) factory = ClassUtils.newInstance(className);
       obj.put (className, factory);
   
  +    if (factory instanceof Loggable) {
  +        ((Loggable)factory).setLogger(this.log);
  +    }
       if (factory instanceof CodeFactory) {
           return ((CodeFactory) factory).generateParameterSource(conf);
       }
  @@ -67,6 +79,9 @@
           if (factory == null) factory = ClassUtils.newInstance(className);
           obj.put (className, factory);
   
  +        if (factory instanceof Loggable) {
  +            ((Loggable)factory).setLogger(this.log);
  +        }
           if (factory instanceof CodeFactory) {
               return ((CodeFactory) factory).generateMethodSource(conf);
           }
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.3   +51 -47    xml-cocoon/src/org/apache/cocoon/transformation/Attic/I18nTransformer.java
  
  Index: I18nTransformer.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/transformation/Attic/I18nTransformer.java,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- I18nTransformer.java	2001/01/08 23:24:05	1.1.2.2
  +++ I18nTransformer.java	2001/01/22 21:56:51	1.1.2.3
  @@ -16,6 +16,7 @@
   import org.apache.avalon.ComponentManager;
   import org.apache.avalon.Composer;
   import org.apache.avalon.Parameters;
  +import org.apache.avalon.Loggable;
   
   import org.xml.sax.Attributes;
   import org.xml.sax.EntityResolver;
  @@ -94,16 +95,16 @@
    * @author <a href="mailto:lassi.immonen@valkeus.com">Lassi Immonen</a>
    */
   public class I18nTransformer extends AbstractTransformer implements Composer {
  -    
  +
       protected ComponentManager manager;
  -    
  +
       public Map dictionary;
  -    
  +
       //apache.org/cocoon/i18n";
  -    public final static String I18N_NAMESPACE_URI = 
  +    public final static String I18N_NAMESPACE_URI =
               "http://apache.org/cocoon/i18n";
       public final static String I18N_ELEMENT = "i18n";
  -    
  +
       public final static String I18N_ELEMENT_KEY_ATTRIBUTE = "key";
       public final static String I18N_ENTRY_ELEMENT = "entry";
       public final static String I18N_TRANSLATION_ELEMENT = "translation";
  @@ -112,45 +113,45 @@
       public final static String I18N_TR_ATTRIBUTE = "tr";
       public final static String I18N_TR_ELEMENT = "tr";
       public final static String I18N_IMAGE_ELEMENT = "image";
  -    
  +
       protected boolean translate_image = false;
       protected boolean translate = false;
       protected boolean is_element = false;
       protected String lang;
  -    
  -    
  +
  +
       /**
        *  Uses <code>org.apache.cocoon.acting.LangSelect.getLang()</code>
        *  to get language user has selected. First it checks is lang set in
        *  objectModel.
        */
  -    
  +
       public void setup(EntityResolver resolver, Map objectModel, String source,
  -            Parameters parameters) 
  +            Parameters parameters)
               throws ProcessingException, SAXException, IOException {
  -        
  +
           lang = (String)(objectModel.get("lang"));
           if (lang == null) {
               lang = LangSelect.getLang(objectModel, parameters);
           }
  -        
  +
           String translations_file = parameters.getParameter("src", null);
  -        
  -        URL tr = 
  +
  +        URL tr =
                   new URL(resolver.resolveEntity(null,
                   translations_file).getSystemId());
           initialiseDictionary(tr);
       }
  -    
  -    
  +
  +
       public void compose(ComponentManager manager) {
           this.manager = manager;
       }
  -    
  -    
  +
  +
       public void startElement(String uri, String name, String raw,
               Attributes attr) throws SAXException {
  -        
  +
           if (I18N_NAMESPACE_URI.equals(uri) && I18N_TR_ELEMENT.equals(name)) {
               translate = true;
               is_element = true;
  @@ -163,7 +164,7 @@
           }
           if (attr != null) {
               AttributesImpl temp_attr = new AttributesImpl(attr);
  -            int attr_index = 
  +            int attr_index =
                       temp_attr.getIndex(I18N_NAMESPACE_URI, I18N_TR_ATTRIBUTE);
               if (attr_index != -1) {
                   translate = true;
  @@ -174,9 +175,9 @@
           }
           super.startElement(uri, name, raw, attr);
       }
  -    
  -    
  -    public void endElement(String uri, String name, String raw) 
  +
  +
  +    public void endElement(String uri, String name, String raw)
               throws SAXException {
           if (translate) {
               translate = false;
  @@ -188,12 +189,12 @@
               is_element = false;
               return;
           }
  -        
  +
           super.endElement(uri, name, raw);
       }
  -    
  -    
  -    
  +
  +
  +
       /**
        *Gets translations from xml file to dictionary.
        */
  @@ -201,14 +202,14 @@
           boolean in_entry = false;
           boolean in_key = false;
           boolean in_translation = false;
  -        
  +
           String key = null;
           String translation = null;
  -        
  -        
  +
  +
           public void startElement(String namespace, String name, String raw,
                   Attributes attr) throws SAXException {
  -            
  +
               if (name.equals(I18N_ENTRY_ELEMENT)) {
                   in_entry = true;
               } else {
  @@ -216,7 +217,7 @@
                       if (name.equals(I18N_KEY_ELEMENT)) {
                           in_key = true;
                       } else {
  -                        if (name.equals(I18N_TRANSLATION_ELEMENT) 
  +                        if (name.equals(I18N_TRANSLATION_ELEMENT)
                                   && attr.getValue(I18N_LANG).equals(lang)) {
                               in_translation = true;
                           }
  @@ -224,11 +225,11 @@
                   }
               }
           }
  -        
  -        
  -        public void endElement(String namespace, String name, String raw) 
  +
  +
  +        public void endElement(String namespace, String name, String raw)
                   throws SAXException {
  -            
  +
               if (name.equals(I18N_ENTRY_ELEMENT)) {
                   if (key != null && translation != null) {
                       dictionary.put(key, translation);
  @@ -243,15 +244,15 @@
                       in_translation = false;
                   }
               }
  -            
  +
           }
  -        
  -        
  -        public void characters(char[] ary, int start, int length) 
  +
  +
  +        public void characters(char[] ary, int start, int length)
                   throws SAXException {
               if (in_key) {
                   key = new String(ary, start, length);
  -                
  +
               } else {
                   if (in_translation) {
                       translation = new String(ary, start, length);
  @@ -286,19 +287,22 @@
       /**
        *Loads translations from given URL
        */
  -    private void initialiseDictionary(URL url) 
  +    private void initialiseDictionary(URL url)
               throws SAXException, MalformedURLException, IOException {
  -        
  +
           Object object = url.getContent();
           Parser parser = null;
           try {
               parser = (Parser)(manager.lookup(Roles.PARSER));
  -            
  +
           } catch (Exception e) {
               log.error("Could not find component", e);
               return;
  -        } 
  +        }
           InputSource input;
  +        if (object instanceof Loggable) {
  +            ((Loggable)object).setLogger(this.log);
  +        }
           if (object instanceof Reader) {
               input = new InputSource((Reader)(object));
           } else if (object instanceof InputStream) {
  @@ -306,12 +310,12 @@
           } else {
               throw new SAXException("Unknown object type: " + object);
           }
  -        
  +
           // How this could be cached?
           dictionary = new Hashtable();
           I18nContentHandler i18n_handler = new I18nContentHandler();
           parser.setContentHandler(i18n_handler);
           parser.parse(input);
  -        
  +
       }
   }
  
  
  
  1.1.2.17  +10 -4     xml-cocoon/src/org/apache/cocoon/transformation/Attic/SQLTransformer.java
  
  Index: SQLTransformer.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/transformation/Attic/SQLTransformer.java,v
  retrieving revision 1.1.2.16
  retrieving revision 1.1.2.17
  diff -u -r1.1.2.16 -r1.1.2.17
  --- SQLTransformer.java	2001/01/08 15:29:45	1.1.2.16
  +++ SQLTransformer.java	2001/01/22 21:56:51	1.1.2.17
  @@ -32,7 +32,7 @@
   import org.apache.cocoon.util.ClassUtils;
   
   import org.apache.log.Logger;
  -import org.apache.log.LogKit;
  +import org.apache.avalon.Loggable;
   
   import org.xml.sax.ContentHandler;
   import org.xml.sax.EntityResolver;
  @@ -47,12 +47,12 @@
    * @author <a href="mailto:balld@webslingerZ.com">Donald Ball</a>
    * @author <a href="mailto:giacomo.pati@pwr.ch">Giacomo Pati</a>
    *         (PWR Organisation & Entwicklung)
  - * @version CVS $Revision: 1.1.2.16 $ $Date: 2001/01/08 15:29:45 $ $Author: bloritsch $
  + * @version CVS $Revision: 1.1.2.17 $ $Date: 2001/01/22 21:56:51 $ $Author: bloritsch $
    */
   
  -public class SQLTransformer extends AbstractTransformer implements Composer {
  +public class SQLTransformer extends AbstractTransformer implements Composer, Loggable {
   
  -    private Logger log = LogKit.getLoggerFor("cocoon");
  +    private Logger log;
   
       /** The SQL namespace **/
       public static final String my_uri = "http://apache.org/cocoon/SQL";
  @@ -109,6 +109,12 @@
               this.dbSelector = (ComponentSelector) manager.lookup(Roles.DB_CONNECTION);
           } catch (ComponentManagerException cme) {
               this.log.warn("Could not get the DataSource Selector", cme);
  +        }
  +    }
  +
  +    public void setLogger(Logger logger) {
  +        if (this.log == null) {
  +            this.log = logger;
           }
       }
   
  
  
  
  1.1.2.15  +16 -4     xml-cocoon/src/org/apache/cocoon/transformation/Attic/XIncludeTransformer.java
  
  Index: XIncludeTransformer.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/transformation/Attic/XIncludeTransformer.java,v
  retrieving revision 1.1.2.14
  retrieving revision 1.1.2.15
  diff -u -r1.1.2.14 -r1.1.2.15
  --- XIncludeTransformer.java	2000/12/11 15:06:10	1.1.2.14
  +++ XIncludeTransformer.java	2001/01/22 21:56:51	1.1.2.15
  @@ -35,7 +35,7 @@
   import org.apache.cocoon.xml.dom.DOMStreamer;
   import org.apache.xpath.XPathAPI;
   
  -import org.apache.log.LogKit;
  +import org.apache.avalon.Loggable;
   import org.apache.log.Logger;
   
   import javax.xml.transform.TransformerException;
  @@ -48,11 +48,11 @@
    * by the SAX event FSM yet.
    *
    * @author <a href="mailto:balld@webslingerZ.com">Donald Ball</a>
  - * @version CVS $Revision: 1.1.2.14 $ $Date: 2000/12/11 15:06:10 $ $Author: bloritsch $
  + * @version CVS $Revision: 1.1.2.15 $ $Date: 2001/01/22 21:56:51 $ $Author: bloritsch $
    */
  -public class XIncludeTransformer extends AbstractTransformer implements Composer {
  +public class XIncludeTransformer extends AbstractTransformer implements Composer, Loggable {
   
  -    protected Logger log = LogKit.getLoggerFor("cocoon");
  +    protected Logger log;
   
       protected ComponentManager manager = null;
   
  @@ -82,6 +82,12 @@
   
       protected Stack xmlbase_element_name_stack = new Stack();
   
  +    public void setLogger(Logger logger) {
  +        if (this.log == null) {
  +            this.log = logger;
  +        }
  +    }
  +
       public void setup(EntityResolver resolver, Map objectModel,
                         String source, Parameters parameters)
               throws ProcessingException, SAXException, IOException {}
  @@ -188,6 +194,9 @@
           log.debug("Object: "+object);
           if (parse.equals("text")) {
               log.debug("Parse type is text");
  +            if (object instanceof Loggable) {
  +                ((Loggable)object).setLogger(this.log);
  +            }
               if (object instanceof Reader) {
                   Reader reader = (Reader)object;
                   int read;
  @@ -221,6 +230,9 @@
                   return;
               }
               InputSource input;
  +            if (object instanceof Loggable) {
  +                ((Loggable)object).setLogger(this.log);
  +            }
               if (object instanceof Reader) {
                   input = new InputSource((Reader)object);
               } else if (object instanceof InputStream) {
  
  
  
  1.1.2.9   +33 -8     xml-cocoon/src/org/apache/cocoon/transformation/Attic/XTTransformer.java
  
  Index: XTTransformer.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/transformation/Attic/XTTransformer.java,v
  retrieving revision 1.1.2.8
  retrieving revision 1.1.2.9
  diff -u -r1.1.2.8 -r1.1.2.9
  --- XTTransformer.java	2000/12/08 20:40:44	1.1.2.8
  +++ XTTransformer.java	2001/01/22 21:56:51	1.1.2.9
  @@ -64,16 +64,17 @@
   import javax.xml.parsers.ParserConfigurationException;
   
   import org.apache.log.Logger;
  -import org.apache.log.LogKit;
  +import org.apache.avalon.Loggable;
   
   /**
    * This Transformer use the XT processor.
    *
    * @author <a href="mailto:ssahuc@imediation.com">Sahuc Sebastien</a>
  - * @version CVS $Revision: 1.1.2.8 $ $Date: 2000/12/08 20:40:44 $
  + * @version CVS $Revision: 1.1.2.9 $ $Date: 2001/01/22 21:56:51 $
    */
   public class XTTransformer extends DocumentHandlerWrapper
  -implements Transformer, Composer {
  +implements Transformer, Composer, Loggable {
  +    private Logger log;
   
       /** The store service instance */
       private Store store = null;
  @@ -84,6 +85,12 @@
       /**The DocumentHandler */
       private DocumentHandler docHandler = null;
   
  +    public void setLogger(Logger logger) {
  +        if (this.log == null) {
  +            this.log = logger;
  +        }
  +    }
  +
       /**
        * Set the current <code>ComponentManager</code> instance used by this
        * <code>Composer</code>.
  @@ -123,11 +130,13 @@
   
           if (store != null) {
               loaderprocessor = (XTProcessor) store.get(xsluri);
  +            loaderprocessor.setLogger(this.log);
           }
   
           // If not in the store or if style sheet has changed, loads and stores it
           if (loaderprocessor == null || loaderprocessor.hasChanged()) {
               loaderprocessor= new XTProcessor();
  +            loaderprocessor.setLogger(this.log);
               SAXParser saxParser = null;
               try {
                   saxParser = SAXParserFactory.newInstance().newSAXParser();
  @@ -144,10 +153,13 @@
           // Always clone the processor before using it,
           // Indeed 1 instance per thread is allowed
           this.processor = (XTProcessor) loaderprocessor.clone();
  +        this.processor.setLogger(this.log);
   
           // Create the processor and set it as this documenthandler
           // FIXME (SS): set the correct SystemId to the XML inputSource
  -        this.docHandler = new DocHandler(processor.createBuilder("XTSystemID"));
  +        DocHandler temp = new DocHandler(processor.createBuilder("XTSystemID"));
  +        temp.setLogger(this.log);
  +        this.docHandler = temp;
           this.setDocumentHandler(this.docHandler);
       }
   
  @@ -187,8 +199,8 @@
       /**
       * inner class DocumentHandler that delegates all SAX Events to the XT's builder.
       */
  -    class DocHandler implements DocumentHandler, DTDHandler {
  -        protected Logger log = LogKit.getLoggerFor("cocoon");
  +    class DocHandler implements DocumentHandler, DTDHandler, Loggable {
  +        protected Logger log;
   
           /**
           * The XT's DocumentHandler instance to which SAX events are forwarded
  @@ -202,6 +214,12 @@
               this.builder = builder;
           }
   
  +    public void setLogger(Logger logger) {
  +        if (this.log == null) {
  +            this.log = logger;
  +        }
  +    }
  +
           public void setDocumentLocator (Locator locator) {
               builder.setDocumentLocator(locator);
           }
  @@ -258,9 +276,9 @@
     * The XT processor.
     */
   
  -class XTProcessor implements Cloneable, ParameterSet, Modifiable {
  +class XTProcessor implements Cloneable, ParameterSet, Modifiable, Loggable {
   
  -    protected Logger log = LogKit.getLoggerFor("cocoon");
  +    protected Logger log;
       private XMLProcessorEx sheetLoader;
       private Parser sheetParser;
       private Sheet sheet;
  @@ -273,6 +291,12 @@
       private File xslFile;
       private long lastModified;
   
  +    public void setLogger(Logger logger) {
  +        if (this.log == null) {
  +            this.log = logger;
  +        }
  +    }
  +
       /**
       * set the Parser that will parse the XSL style sheet
       */
  @@ -379,6 +403,7 @@
       public Object clone() {
           try {
               XTProcessor cloned = (XTProcessor) super.clone();
  +            cloned.setLogger(this.log);
               cloned.params = (HashMap) cloned.params.clone();
               return cloned;
           } catch (CloneNotSupportedException e) {
  
  
  
  1.1.2.28  +5 -1      xml-cocoon/src/org/apache/cocoon/transformation/Attic/XalanTransformer.java
  
  Index: XalanTransformer.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/transformation/Attic/XalanTransformer.java,v
  retrieving revision 1.1.2.27
  retrieving revision 1.1.2.28
  diff -u -r1.1.2.27 -r1.1.2.28
  --- XalanTransformer.java	2001/01/05 16:21:04	1.1.2.27
  +++ XalanTransformer.java	2001/01/22 21:56:51	1.1.2.28
  @@ -25,6 +25,7 @@
   import org.apache.avalon.Configuration;
   import org.apache.avalon.Poolable;
   import org.apache.avalon.Parameters;
  +import org.apache.avalon.Loggable;
   
   import org.apache.cocoon.Cocoon;
   import org.apache.cocoon.Roles;
  @@ -54,7 +55,7 @@
    *         (Apache Software Foundation, Exoffice Technologies)
    * @author <a href="mailto:dims@yahoo.com">Davanum Srinivas</a>
    * @author <a href="mailto:cziegeler@sundn.de">Carsten Ziegeler</a>
  - * @version CVS $Revision: 1.1.2.27 $ $Date: 2001/01/05 16:21:04 $
  + * @version CVS $Revision: 1.1.2.28 $ $Date: 2001/01/22 21:56:51 $
    */
   public class XalanTransformer extends ContentHandlerWrapper
   implements Transformer, Composer, Poolable, Configurable {
  @@ -203,6 +204,9 @@
           }
   
           super.setContentHandler(transformerHandler);
  +        if(transformerHandler instanceof Loggable) {
  +            ((Loggable)transformerHandler).setLogger(this.log);
  +        }
           if(transformerHandler instanceof org.xml.sax.ext.LexicalHandler)
               this.setLexicalHandler((org.xml.sax.ext.LexicalHandler)transformerHandler);
       }
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.3   +20 -14    xml-cocoon/src/org/apache/cocoon/util/Attic/ComponentPool.java
  
  Index: ComponentPool.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/util/Attic/ComponentPool.java,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- ComponentPool.java	2000/12/10 21:21:16	1.1.2.2
  +++ ComponentPool.java	2001/01/22 21:56:53	1.1.2.3
  @@ -9,12 +9,12 @@
   
   import org.apache.avalon.Poolable;
   import org.apache.avalon.ThreadSafe;
  +import org.apache.avalon.Loggable;
   import org.apache.avalon.util.pool.AbstractPool;
   import org.apache.avalon.util.pool.ObjectFactory;
   import org.apache.avalon.util.pool.PoolController;
   
   import org.apache.log.Logger;
  -import org.apache.log.LogKit;
   
   /**
    * This is a implementation of <code>Pool</code> for SitemapComponents
  @@ -22,11 +22,11 @@
    *
    * @author <a href="mailto:Giacomo.Pati@pwr.ch">Giacomo Pati</a>
    */
  -public class ComponentPool extends AbstractPool implements ThreadSafe {
  +public class ComponentPool extends AbstractPool implements ThreadSafe, Loggable {
   
       public final static int DEFAULT_POOL_SIZE = 16;
   
  -    private Logger log = LogKit.getLoggerFor("cocoon");
  +    private Logger log;
   
       public ComponentPool(final ObjectFactory factory,
                            final PoolController controller) throws Exception {
  @@ -46,6 +46,12 @@
           super(factory, controller, initial, maximum);
       }
   
  +    public void setLogger(Logger log) {
  +        if (this.log == null) {
  +            this.log = log;
  +        }
  +    }
  +
       /**
        * Retrieve an object from pool.
        *
  @@ -53,12 +59,12 @@
        */
       public final Poolable get() throws Exception {
           synchronized(m_pool) {
  -			Poolable component = super.get();
  -			log.debug(
  -				"ComponentPool retrieved " 
  -				+ component.getClass().getName() 
  -				+ " (" + component.toString() + ")"
  -			);
  +            Poolable component = super.get();
  +            log.debug(
  +                "ComponentPool retrieved "
  +                + component.getClass().getName()
  +                + " (" + component.toString() + ")"
  +            );
               return component;
           }
       }
  @@ -71,11 +77,11 @@
       public final void put(final Poolable poolable) {
           synchronized(m_pool) {
               super.put(poolable);
  -			log.debug(
  -				"ComponentPool returned "
  -				+ poolable.getClass().getName()
  -				+ " (" + poolable.toString() + ")"
  -			);
  +            log.debug(
  +                "ComponentPool returned "
  +                + poolable.getClass().getName()
  +                + " (" + poolable.toString() + ")"
  +            );
           }
       }
   }
  
  
  
  1.1.2.2   +5 -5      xml-cocoon/src/org/apache/cocoon/util/Attic/ComponentPoolController.java
  
  Index: ComponentPoolController.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/util/Attic/ComponentPoolController.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- ComponentPoolController.java	2000/10/13 04:05:41	1.1.2.1
  +++ ComponentPoolController.java	2001/01/22 21:56:53	1.1.2.2
  @@ -18,12 +18,12 @@
   
   import org.apache.cocoon.util.ClassUtils;
   
  -/** 
  - * This class holds a sitemap component which is not specially marked as having 
  +/**
  + * This class holds a sitemap component which is not specially marked as having
    * a spezial behaviour or treatment.
    *
    * @author <a href="mailto:Giacomo.Pati@pwr.ch">Giacomo Pati</a>
  - * @version CVS $Revision: 1.1.2.1 $ $Date: 2000/10/13 04:05:41 $
  + * @version CVS $Revision: 1.1.2.2 $ $Date: 2001/01/22 21:56:53 $
    */
   public class ComponentPoolController implements PoolController, ThreadSafe, Component {
   
  @@ -50,7 +50,7 @@
       /*
           if (sizing_direction < 0 && amount > 1)
               amount /= 2;
  -	    sizing_direction = 1;
  +        sizing_direction = 1;
       */
           return amount;
       }
  @@ -64,7 +64,7 @@
       /*
           if (sizing_direction > 0 && amount > 1)
               amount /= 2;
  -	    sizing_direction = -1;
  +        sizing_direction = -1;
       */
           return amount;
       }
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.6   +10 -4     xml-cocoon/src/org/apache/cocoon/xml/Attic/AbstractXMLConsumer.java
  
  Index: AbstractXMLConsumer.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/xml/Attic/AbstractXMLConsumer.java,v
  retrieving revision 1.1.2.5
  retrieving revision 1.1.2.6
  diff -u -r1.1.2.5 -r1.1.2.6
  --- AbstractXMLConsumer.java	2000/11/10 22:38:56	1.1.2.5
  +++ AbstractXMLConsumer.java	2001/01/22 21:56:54	1.1.2.6
  @@ -14,7 +14,7 @@
   import org.xml.sax.ext.LexicalHandler;
   
   import org.apache.log.Logger;
  -import org.apache.log.LogKit;
  +import org.apache.avalon.Loggable;
   
   /**
    * This abstract class provides default implementation of the methods specified
  @@ -22,11 +22,17 @@
    *
    * @author <a href="mailto:fumagalli@exoffice.com">Pierpaolo Fumagalli</a>
    *         (Apache Software Foundation, Exoffice Technologies)
  - * @version CVS $Revision: 1.1.2.5 $ $Date: 2000/11/10 22:38:56 $
  + * @version CVS $Revision: 1.1.2.6 $ $Date: 2001/01/22 21:56:54 $
    */
  -public abstract class AbstractXMLConsumer implements XMLConsumer {
  +public abstract class AbstractXMLConsumer implements XMLConsumer, Loggable {
   
  -    protected Logger log = LogKit.getLoggerFor("cocoon");
  +    protected Logger log;
  +
  +    public void setLogger(Logger logger) {
  +        if (this.log == null) {
  +            this.log = logger;
  +        }
  +    }
   
       /**
        * Receive an object for locating the origin of SAX document events.
  
  
  
  1.1.2.7   +13 -7     xml-cocoon/src/org/apache/cocoon/xml/Attic/AbstractXMLProducer.java
  
  Index: AbstractXMLProducer.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/xml/Attic/AbstractXMLProducer.java,v
  retrieving revision 1.1.2.6
  retrieving revision 1.1.2.7
  diff -u -r1.1.2.6 -r1.1.2.7
  --- AbstractXMLProducer.java	2000/11/10 22:38:56	1.1.2.6
  +++ AbstractXMLProducer.java	2001/01/22 21:56:54	1.1.2.7
  @@ -10,24 +10,24 @@
   import org.xml.sax.ContentHandler;
   import org.xml.sax.ext.LexicalHandler;
   
  -import org.apache.log.LogKit;
  +import org.apache.avalon.Loggable;
   import org.apache.log.Logger;
   
   /**
    * This abstract class provides default implementation of the methods specified
  - * by the <code>XMLProducer</code> interface. 
  + * by the <code>XMLProducer</code> interface.
    *
    * @author <a href="mailto:fumagalli@exoffice.com">Pierpaolo Fumagalli</a>
    *         (Apache Software Foundation, Exoffice Technologies)
  - * @version CVS $Revision: 1.1.2.6 $ $Date: 2000/11/10 22:38:56 $
  + * @version CVS $Revision: 1.1.2.7 $ $Date: 2001/01/22 21:56:54 $
    */
  -public abstract class AbstractXMLProducer implements XMLProducer {
  +public abstract class AbstractXMLProducer implements XMLProducer, Loggable {
   
  -    protected Logger log = LogKit.getLoggerFor("cocoon");
  -    
  +    protected Logger log;
  +
       /** The <code>ContentHandler</code> receiving SAX events. */
       protected ContentHandler contentHandler;
  -    
  +
       /** The <code>LexicalHandler</code> receiving SAX events. */
       protected LexicalHandler lexicalHandler;
   
  @@ -40,6 +40,12 @@
       public void setConsumer(XMLConsumer consumer) {
           this.contentHandler = consumer;
           this.lexicalHandler = consumer;
  +    }
  +
  +    public void setLogger(Logger logger) {
  +        if (this.log == null) {
  +            this.log = logger;
  +        }
       }
   
       /**
  
  
  
  1.1.2.4   +17 -11    xml-cocoon/src/org/apache/cocoon/xml/Attic/ContentHandlerWrapper.java
  
  Index: ContentHandlerWrapper.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/xml/Attic/ContentHandlerWrapper.java,v
  retrieving revision 1.1.2.3
  retrieving revision 1.1.2.4
  diff -u -r1.1.2.3 -r1.1.2.4
  --- ContentHandlerWrapper.java	2001/01/07 00:13:05	1.1.2.3
  +++ ContentHandlerWrapper.java	2001/01/22 21:56:55	1.1.2.4
  @@ -5,7 +5,7 @@
    * version 1.1, a copy of which has been included  with this distribution in *
    * the LICENSE file.                                                         *
    *****************************************************************************/
  - 
  +
   package org.apache.cocoon.xml;
   
   import java.util.Vector;
  @@ -19,7 +19,7 @@
   import org.xml.sax.SAXException;
   import org.xml.sax.helpers.AttributeListImpl;
   
  -import org.apache.log.LogKit;
  +import org.apache.avalon.Loggable;
   import org.apache.log.Logger;
   
   /**
  @@ -30,11 +30,11 @@
    *
    * @author <a href="mailto:dims@yahoo.com">Davanum Srinivas</a>
    *         (Apache Software Foundation, Computer Associates)
  - * @version CVS $Revision: 1.1.2.3 $ $Date: 2001/01/07 00:13:05 $
  + * @version CVS $Revision: 1.1.2.4 $ $Date: 2001/01/22 21:56:55 $
    */
  -public class ContentHandlerWrapper extends AbstractXMLConsumer implements Recyclable {
  +public class ContentHandlerWrapper extends AbstractXMLConsumer implements Recyclable, Loggable {
   
  -    protected Logger log = LogKit.getLoggerFor("cocoon");
  +    protected Logger log;
   
       /** The current <code>ContentHandler</code>. */
       protected ContentHandler documentHandler=null;
  @@ -54,6 +54,12 @@
           this.setContentHandler(document);
       }
   
  +    public void setLogger(Logger logger) {
  +        if (this.log == null) {
  +            this.log = logger;
  +        }
  +    }
  +
       /**
        * Set the <code>ContentHandler</code> that will receive XML data.
        *
  @@ -77,26 +83,26 @@
           if (this.documentHandler==null) return;
           else this.documentHandler.setDocumentLocator(locator);
       }
  -    
  +
       /**
        * Receive notification of the beginning of a document.
        */
       public void startDocument ()
  -	throws SAXException {
  +    throws SAXException {
           if (this.documentHandler==null)
               throw new SAXException("ContentHandler not set");
           this.documentHandler.startDocument();
  -    }    
  -    
  +    }
  +
       /**
        * Receive notification of the end of a document.
        */
       public void endDocument ()
  -	throws SAXException {
  +    throws SAXException {
           if (this.documentHandler==null)
               throw new SAXException("ContentHandler not set");
           this.documentHandler.endDocument();
  -    }    
  +    }
   
       /**
        * Begin the scope of a prefix-URI Namespace mapping.
  
  
  
  1.1.2.4   +18 -12    xml-cocoon/src/org/apache/cocoon/xml/Attic/DocumentHandlerWrapper.java
  
  Index: DocumentHandlerWrapper.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/xml/Attic/DocumentHandlerWrapper.java,v
  retrieving revision 1.1.2.3
  retrieving revision 1.1.2.4
  diff -u -r1.1.2.3 -r1.1.2.4
  --- DocumentHandlerWrapper.java	2000/12/08 20:40:58	1.1.2.3
  +++ DocumentHandlerWrapper.java	2001/01/22 21:56:55	1.1.2.4
  @@ -5,7 +5,7 @@
    * version 1.1, a copy of which has been included  with this distribution in *
    * the LICENSE file.                                                         *
    *****************************************************************************/
  - 
  +
   package org.apache.cocoon.xml;
   
   import java.util.Vector;
  @@ -21,25 +21,25 @@
   import org.xml.sax.helpers.AttributeListImpl;
   
   import org.apache.log.Logger;
  -import org.apache.log.LogKit;
  +import org.apache.avalon.Loggable;
   
   /**
    * This class is an utility class &quot;wrapping&quot; around a SAX version 1.0
    * <code>DocumentHandler</code> and forwarding it those events received throug
    * its <code>XMLConsumers</code> interface.
    * <br>
  - * This class fully supports XML namespaces, converting 
  + * This class fully supports XML namespaces, converting
    * <code>startPrefixMapping(...)</code> and <code>endPrefixMapping(...)</code>
    * calls into appropriate <code>xmlns</code> and <code>xmlns:...</code> element
    * attributes.
    *
    * @author <a href="mailto:fumagalli@exoffice.com">Pierpaolo Fumagalli</a>
    *         (Apache Software Foundation, Exoffice Technologies)
  - * @version CVS $Revision: 1.1.2.3 $ $Date: 2000/12/08 20:40:58 $
  + * @version CVS $Revision: 1.1.2.4 $ $Date: 2001/01/22 21:56:55 $
    */
  -public class DocumentHandlerWrapper extends AbstractXMLConsumer /*implements Recyclable*/ {
  +public class DocumentHandlerWrapper extends AbstractXMLConsumer implements Loggable /*, Recyclable*/ {
   
  -    protected Logger log = LogKit.getLoggerFor("cocoon");
  +    protected Logger log;
   
       /** The current namespaces table. */
       private NamespacesTable namespaces=new NamespacesTable();
  @@ -64,6 +64,12 @@
           this.setDocumentHandler(document);
       }
   
  +    public void setLogger(Logger logger) {
  +        if (this.log == null) {
  +            this.log = logger;
  +        }
  +    }
  +
       /**
        * Implementation of the recycle method
        */
  @@ -90,26 +96,26 @@
           if (this.documentHandler==null) return;
           else this.documentHandler.setDocumentLocator(locator);
       }
  -    
  +
       /**
        * Receive notification of the beginning of a document.
        */
       public void startDocument ()
  -	throws SAXException {
  +    throws SAXException {
           if (this.documentHandler==null)
               throw new SAXException("DocumentHandler not set");
           this.documentHandler.startDocument();
  -    }    
  -    
  +    }
  +
       /**
        * Receive notification of the end of a document.
        */
       public void endDocument ()
  -	throws SAXException {
  +    throws SAXException {
           if (this.documentHandler==null)
               throw new SAXException("DocumentHandler not set");
           this.documentHandler.endDocument();
  -    }    
  +    }
   
       /**
        * Begin the scope of a prefix-URI Namespace mapping.
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.8   +10 -4     xml-cocoon/src/org/apache/cocoon/xml/dom/Attic/DOMBuilder.java
  
  Index: DOMBuilder.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/xml/dom/Attic/DOMBuilder.java,v
  retrieving revision 1.1.2.7
  retrieving revision 1.1.2.8
  diff -u -r1.1.2.7 -r1.1.2.8
  --- DOMBuilder.java	2001/01/09 13:28:51	1.1.2.7
  +++ DOMBuilder.java	2001/01/22 21:56:56	1.1.2.8
  @@ -31,7 +31,7 @@
   import org.xml.sax.Locator;
   import org.xml.sax.SAXException;
   
  -import org.apache.log.LogKit;
  +import org.apache.avalon.Loggable;
   import org.apache.log.Logger;
   
   /**
  @@ -40,10 +40,10 @@
    *
    * @author <a href="mailto:fumagalli@exoffice.com">Pierpaolo Fumagalli</a>
    *         (Apache Software Foundation, Exoffice Technologies)
  - * @version CVS $Revision: 1.1.2.7 $ $Date: 2001/01/09 13:28:51 $
  + * @version CVS $Revision: 1.1.2.8 $ $Date: 2001/01/22 21:56:56 $
    */
  -public class DOMBuilder implements XMLConsumer {
  -    protected Logger log = LogKit.getLoggerFor("cocoon");
  +public class DOMBuilder implements XMLConsumer, Loggable {
  +    protected Logger log;
       /** The document was not started */
       private static final int S_AVAIL=0;
       /** State between startDTD() and endDTD() */
  @@ -84,6 +84,12 @@
        */
       protected DOMBuilder() {
           this(null,null);
  +    }
  +
  +    public void setLogger(Logger logger) {
  +        if (this.log == null) {
  +            this.log = logger;
  +        }
       }
   
       /**
  
  
  
  1.1.2.4   +29 -23    xml-cocoon/src/org/apache/cocoon/xml/dom/Attic/SVGBuilder.java
  
  Index: SVGBuilder.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/xml/dom/Attic/SVGBuilder.java,v
  retrieving revision 1.1.2.3
  retrieving revision 1.1.2.4
  diff -u -r1.1.2.3 -r1.1.2.4
  --- SVGBuilder.java	2001/01/08 16:32:56	1.1.2.3
  +++ SVGBuilder.java	2001/01/22 21:56:56	1.1.2.4
  @@ -30,7 +30,7 @@
   import org.xml.sax.Locator;
   import org.xml.sax.SAXException;
   
  -import org.apache.log.LogKit;
  +import org.apache.avalon.Loggable;
   import org.apache.log.Logger;
   
   import org.apache.batik.dom.svg.SAXSVGDocumentFactory;
  @@ -38,14 +38,14 @@
   import org.apache.batik.css.CSSDocumentHandler;
   
   /**
  - * The <code>SVGBuilder</code> is a utility class that will generate a 
  + * The <code>SVGBuilder</code> is a utility class that will generate a
    * SVG-DOM Document from SAX events using Batik's SVGDocumentFactory.
    *
    * @author <a href="mailto:dims@yahoo.com">Davanum Srinivas</a>
  - * @version CVS $Revision: 1.1.2.3 $ $Date: 2001/01/08 16:32:56 $
  + * @version CVS $Revision: 1.1.2.4 $ $Date: 2001/01/22 21:56:56 $
    */
  -public class SVGBuilder extends SAXSVGDocumentFactory implements XMLConsumer {
  -    protected Logger log = LogKit.getLoggerFor("cocoon");
  +public class SVGBuilder extends SAXSVGDocumentFactory implements XMLConsumer, Loggable {
  +    protected Logger log;
   
       private static final String SAX_PARSER
           = "org.apache.xerces.parsers.SAXParser";
  @@ -53,9 +53,9 @@
       private final static String CSS_PARSER_CLASS_NAME =
           "org.w3c.flute.parser.Parser";
   
  -	static {
  +    static {
           CSSDocumentHandler.setParserClassName(CSS_PARSER_CLASS_NAME);
  -	}
  +    }
   
       /**
        * Construct a new instance of this TreeGenerator.
  @@ -64,6 +64,12 @@
           super(SAX_PARSER);
       }
   
  +    public void setLogger(Logger logger) {
  +        if (this.log == null) {
  +            this.log = logger;
  +        }
  +    }
  +
       /**
        * Return the newly built Document.
        */
  @@ -78,16 +84,16 @@
        */
       public void startDocument()
       throws SAXException {
  -		try {
  -			// Create SVG Document
  -			String namespaceURI = SVGDOMImplementation.SVG_NAMESPACE_URI;
  -			this.document = implementation.createDocument(namespaceURI, "svg", null);
  -			super.startDocument();	
  -		} catch (Exception ex){
  +        try {
  +            // Create SVG Document
  +            String namespaceURI = SVGDOMImplementation.SVG_NAMESPACE_URI;
  +            this.document = implementation.createDocument(namespaceURI, "svg", null);
  +            super.startDocument();
  +        } catch (Exception ex){
               log.error("SVGBuilder: startDocument", ex);
  -			ex.printStackTrace();
  +            ex.printStackTrace();
               throw new SAXException("SVGBuilder: startDocument", ex);
  -		}
  +        }
       }
   
       /**
  @@ -97,18 +103,18 @@
        */
       public void endDocument ()
       throws SAXException {
  -		try {
  -			super.endDocument();
  +        try {
  +            super.endDocument();
   
  -			// FIXME: Hack.
  -			((org.apache.batik.dom.svg.SVGOMDocument)this.document).setURLObject(new java.net.URL("http://xml.apache.org"));
  +            // FIXME: Hack.
  +            ((org.apache.batik.dom.svg.SVGOMDocument)this.document).setURLObject(new java.net.URL("http://xml.apache.org"));
   
  -			this.notify(this.document);
  -		} catch (Exception ex){
  +            this.notify(this.document);
  +        } catch (Exception ex){
               log.error("SVGBuilder: endDocument", ex);
  -			ex.printStackTrace();
  +            ex.printStackTrace();
               throw new SAXException("SVGBuilder: endDocument", ex);
  -		}
  +        }
       }
   
       /**
  
  
  

Mime
View raw message