cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject cvs commit: xml-cocoon2/src/java/org/apache/cocoon Cocoon.java
Date Wed, 11 Sep 2002 10:08:36 GMT
cziegeler    2002/09/11 03:08:36

  Modified:    src/java/org/apache/cocoon/components/treeprocessor/sitemap
                        ActionSetNodeBuilder.java PipelineNodeBuilder.java
                        CallNodeBuilder.java SelectNodeBuilder.java
                        RedirectToNodeBuilder.java
                        AggregateNodeBuilder.java CallNode.java
                        SitemapLanguage.java SitemapNodeBuilder.java
                        PipelineNode.java ActionSetNode.java
                        PreparableMatchNode.java PipelinesNodeBuilder.java
                        PipelinesNode.java ViewNodeBuilder.java
               src/java/org/apache/cocoon/components/treeprocessor
                        NullNode.java AbstractProcessingNodeBuilder.java
                        ContainerNodeBuilder.java DefaultTreeBuilder.java
                        TreeProcessor.java CategoryNode.java
                        AbstractParentProcessingNodeBuilder.java
               src/java/org/apache/cocoon Cocoon.java
  Log:
  And more logging and exception handling updates
  
  Revision  Changes    Path
  1.4       +1 -2      xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/ActionSetNodeBuilder.java
  
  Index: ActionSetNodeBuilder.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/ActionSetNodeBuilder.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ActionSetNodeBuilder.java	24 Jun 2002 20:32:19 -0000	1.3
  +++ ActionSetNodeBuilder.java	11 Sep 2002 10:08:33 -0000	1.4
  @@ -101,7 +101,6 @@
               } else {
                   // Unknown element
                   String msg = "Unknown element " + name + " in action-set at " + childConfig.getLocation();
  -                getLogger().error(msg);
                   throw new ConfigurationException(msg);
               }
           }
  
  
  
  1.4       +1 -3      xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelineNodeBuilder.java
  
  Index: PipelineNodeBuilder.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelineNodeBuilder.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- PipelineNodeBuilder.java	27 May 2002 10:52:09 -0000	1.3
  +++ PipelineNodeBuilder.java	11 Sep 2002 10:08:33 -0000	1.4
  @@ -98,7 +98,6 @@
                       if ( (type == 404 && error404Handler != null) ||
                            (type == 500 && error500Handler != null) ) {
                           String msg = "Duplicate handle-errors at " + handler.getLocation();
  -                        getLogger().error(msg);
                           throw new ConfigurationException(msg);
                       }
   
  @@ -108,7 +107,6 @@
                           error500Handler = handler;
                       } else {
                           String msg = "Unkown handle-errors type (" + type + ") at " + handler.getLocation();
  -                        getLogger().error(msg);
                           throw new ConfigurationException(msg);
                       }
                   } else {
  
  
  
  1.5       +1 -2      xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/CallNodeBuilder.java
  
  Index: CallNodeBuilder.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/CallNodeBuilder.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- CallNodeBuilder.java	19 May 2002 20:28:53 -0000	1.4
  +++ CallNodeBuilder.java	11 Sep 2002 10:08:34 -0000	1.5
  @@ -104,7 +104,6 @@
           if (resources == null) {
               String msg = "This sitemap contains no resources. Cannot call at "
                   + this.node.getLocation();
  -            getLogger().error(msg);
               throw new ConfigurationException(msg);
           }
   
  
  
  
  1.6       +1 -2      xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/SelectNodeBuilder.java
  
  Index: SelectNodeBuilder.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/SelectNodeBuilder.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- SelectNodeBuilder.java	25 Jun 2002 07:55:13 -0000	1.5
  +++ SelectNodeBuilder.java	11 Sep 2002 10:08:34 -0000	1.6
  @@ -117,7 +117,6 @@
               } else {
                   // Unknown element
                   String msg = "Unknown element '" + name + "' in select at " + childConfig.getLocation();
  -                getLogger().error(msg);
                   throw new ConfigurationException(msg);
               }
           }
  
  
  
  1.3       +1 -2      xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/RedirectToNodeBuilder.java
  
  Index: RedirectToNodeBuilder.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/RedirectToNodeBuilder.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- RedirectToNodeBuilder.java	24 Jun 2002 20:32:19 -0000	1.2
  +++ RedirectToNodeBuilder.java	11 Sep 2002 10:08:35 -0000	1.3
  @@ -126,7 +126,6 @@
               if (resources == null) {
                   String msg = "This sitemap contains no resources. Cannot redirect at "
+
                       this.callNode.getLocation();
  -                getLogger().error(msg);
                   throw new ConfigurationException(msg);
               }
   
  
  
  
  1.5       +1 -3      xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/AggregateNodeBuilder.java
  
  Index: AggregateNodeBuilder.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/AggregateNodeBuilder.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AggregateNodeBuilder.java	24 Jun 2002 20:32:19 -0000	1.4
  +++ AggregateNodeBuilder.java	11 Sep 2002 10:08:35 -0000	1.5
  @@ -110,7 +110,6 @@
               if (!"part".equals(childConfig.getName())) {
                   String msg = "Unknown element '" + childConfig.getName() + " in aggregate
' at " +
                       childConfig.getLocation();
  -                getLogger().error(msg);
                   throw new ConfigurationException(msg);
               }
   
  @@ -155,7 +154,6 @@
   
           if (allParts.size() == 0) {
               String msg = "There must be at least one part in map:aggregate at " + config.getLocation();
  -            getLogger().error(msg);
               throw new ConfigurationException(msg);
           }
   
  
  
  
  1.5       +3 -3      xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/CallNode.java
  
  Index: CallNode.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/CallNode.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- CallNode.java	24 Jun 2002 20:32:19 -0000	1.4
  +++ CallNode.java	11 Sep 2002 10:08:35 -0000	1.5
  @@ -139,8 +139,8 @@
           } else {
               // Resolved resource name
               String name = this.resourceResolver.resolve(mapStack, objectModel);
  -            if (getLogger().isInfoEnabled()) {
  -                getLogger().info("Calling resource " + name);
  +            if (getLogger().isDebugEnabled()) {
  +                getLogger().debug("Calling resource " + name);
               }
               
               // and only now push the parameters
  
  
  
  1.9       +11 -6     xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/SitemapLanguage.java
  
  Index: SitemapLanguage.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/SitemapLanguage.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- SitemapLanguage.java	30 Jun 2002 20:45:08 -0000	1.8
  +++ SitemapLanguage.java	11 Sep 2002 10:08:35 -0000	1.9
  @@ -100,7 +100,9 @@
           Configuration config = tree.getChild("components", false);
   
           if (config == null) {
  -            getLogger().debug("Sitemap has no components definition at " + tree.getLocation());
  +            if (this.getLogger().isDebugEnabled()) {
  +                getLogger().debug("Sitemap has no components definition at " + tree.getLocation());
  +            }
               config = new DefaultConfiguration("", "");
           }
   
  @@ -205,7 +207,9 @@
        * @param view the view name
        */
       public void addViewForLabel(String label, String view) {
  -        getLogger().debug("views:addViewForLabel(" + label + ", " + view + ")");
  +        if (this.getLogger().isDebugEnabled()) {
  +            getLogger().debug("views:addViewForLabel(" + label + ", " + view + ")");
  +        }
           Set views = (Set)this.labelViews.get(label);
           if (views == null) {
               views = new HashSet();
  @@ -232,7 +236,6 @@
               // Labels are forbidden inside view definition
               if (statementLabels != null) {
                   String msg = "Cannot put a 'label' attribute inside view definition at
" + statement.getLocation();
  -                getLogger().error(msg);
                   throw new ConfigurationException(msg);
               }
   
  @@ -259,7 +262,7 @@
                   }
               } catch(Exception e) {
                   // Ignore (no selector for this role)
  -                getLogger().debug("No selector for role " + role);
  +                getLogger().warn("No selector for role " + role);
               } finally {
                   this.manager.release( selector );
               }
  @@ -300,7 +303,9 @@
           if (views.size() == 0) {
               views = null;
   
  -            getLogger().debug(statement.getName() + " has no views at " + statement.getLocation());
  +            if (getLogger().isDebugEnabled()) {
  +                getLogger().debug(statement.getName() + " has no views at " + statement.getLocation());
  +            }
           } else {
               if (getLogger().isDebugEnabled()) {
                   // Dump matching views
  
  
  
  1.2       +1 -3      xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/SitemapNodeBuilder.java
  
  Index: SitemapNodeBuilder.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/SitemapNodeBuilder.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SitemapNodeBuilder.java	5 Mar 2002 08:26:23 -0000	1.1
  +++ SitemapNodeBuilder.java	11 Sep 2002 10:08:35 -0000	1.2
  @@ -81,7 +81,6 @@
               if (children[i] instanceof PipelinesNode) {
                   if (pipelines != null) {
                       String msg = "Only one 'pipelines' is allowed, at " + config.getLocation();
  -                    getLogger().error(msg);
                       throw new ConfigurationException(msg);
                   }
                   pipelines = children[i];
  @@ -90,7 +89,6 @@
   
           if (pipelines == null) {
               String msg = "Invalid sitemap : there must be a 'pipelines' at " + config.getLocation();
  -            getLogger().error(msg);
               throw new ConfigurationException(msg);
           }
   
  
  
  
  1.14      +5 -14     xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelineNode.java
  
  Index: PipelineNode.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelineNode.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- PipelineNode.java	8 Aug 2002 03:21:28 -0000	1.13
  +++ PipelineNode.java	11 Sep 2002 10:08:35 -0000	1.14
  @@ -50,25 +50,21 @@
   */
   package org.apache.cocoon.components.treeprocessor.sitemap;
   
  -import org.apache.avalon.framework.activity.Disposable;
   import org.apache.avalon.framework.component.ComponentManager;
   import org.apache.avalon.framework.component.Composable;
   import org.apache.avalon.framework.configuration.Configuration;
  -import org.apache.avalon.framework.parameters.Parameters;
  -
   import org.apache.cocoon.ConnectionResetException;
   import org.apache.cocoon.Constants;
   import org.apache.cocoon.ResourceNotFoundException;
  -
  -import org.apache.cocoon.environment.Environment;
   import org.apache.cocoon.components.notification.Notifying;
   import org.apache.cocoon.components.notification.NotifyingBuilder;
   import org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode;
  -import org.apache.cocoon.components.treeprocessor.ProcessingNode;
  -import org.apache.cocoon.components.treeprocessor.ParameterizableProcessingNode;
   import org.apache.cocoon.components.treeprocessor.InvokeContext;
  +import org.apache.cocoon.components.treeprocessor.ParameterizableProcessingNode;
  +import org.apache.cocoon.components.treeprocessor.ProcessingNode;
  +import org.apache.cocoon.environment.Environment;
   
  -import java.util.*;
  +import java.util.Map;
   
   /**
    * Handles <map:pipeline>
  @@ -158,7 +154,6 @@
                   return true;
               } else if (this.isLast) {
                   String msg = "No pipeline matched request: " + env.getURIPrefix() + env.getURI();
  -                getLogger().info(msg);
                   throw new ResourceNotFoundException(msg);
               } else {
                   return false;
  @@ -167,8 +162,6 @@
               // Will be reported by CocoonServlet, rethrowing
               throw cre;
           } catch(ResourceNotFoundException rnfe) {
  -            getLogger().warn("Resource not found in pipeline at " + getLocation(), rnfe);
  -
               if (error404 != null) {
                   // There's a handler
                   return invokeErrorHandler(error404, rnfe, env);
  @@ -179,11 +172,9 @@
           } catch(Exception e) {
               // Rethrow exception for internal requests
               if (error500 != null && !context.isInternalRequest()) {
  -                getLogger().warn("Error while processing pipeline at " + getLocation(),
e);
                   return invokeErrorHandler(error500, e, env);
               } else {
                   // No handler : propagate
  -                getLogger().error("Error while processing pipeline at " + getLocation(),
e);
                   throw e;
               }
           }
  
  
  
  1.6       +1 -2      xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/ActionSetNode.java
  
  Index: ActionSetNode.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/ActionSetNode.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ActionSetNode.java	9 Aug 2002 07:47:17 -0000	1.5
  +++ ActionSetNode.java	11 Sep 2002 10:08:35 -0000	1.6
  @@ -126,7 +126,6 @@
           // Perform any common invoke functionalty 
           // super.invoke(env, context);
           String msg = "An action-set cannot be invoked, at " + this.getLocation();
  -        getLogger().error(msg);
           throw new UnsupportedOperationException(msg);
       }
   
  
  
  
  1.6       +1 -2      xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/PreparableMatchNode.java
  
  Index: PreparableMatchNode.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/PreparableMatchNode.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- PreparableMatchNode.java	9 Aug 2002 07:47:17 -0000	1.5
  +++ PreparableMatchNode.java	11 Sep 2002 10:08:35 -0000	1.6
  @@ -115,7 +115,6 @@
   
           } catch(PatternException pe) {
               String msg = "Invalid pattern '" + this.pattern + "' for matcher at " + this.getLocation();
  -            getLogger().error(msg, pe);
               throw new ComponentException(msg, pe);
   
           } finally {
  
  
  
  1.5       +1 -2      xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelinesNodeBuilder.java
  
  Index: PipelinesNodeBuilder.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelinesNodeBuilder.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- PipelinesNodeBuilder.java	29 May 2002 12:50:21 -0000	1.4
  +++ PipelinesNodeBuilder.java	11 Sep 2002 10:08:35 -0000	1.5
  @@ -100,7 +100,6 @@
           ProcessingNode[] children = buildChildNodes(config);
           if (children.length == 0) {
               String msg = "There must be at least one pipeline at " + config.getLocation();
  -            getLogger().error(msg);
               throw new ConfigurationException(msg);
           }
   
  
  
  
  1.9       +7 -12     xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelinesNode.java
  
  Index: PipelinesNode.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelinesNode.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- PipelinesNode.java	9 Aug 2002 07:47:17 -0000	1.8
  +++ PipelinesNode.java	11 Sep 2002 10:08:35 -0000	1.9
  @@ -50,23 +50,18 @@
   */
   package org.apache.cocoon.components.treeprocessor.sitemap;
   
  +import org.apache.avalon.framework.activity.Disposable;
   import org.apache.avalon.framework.component.ComponentManager;
   import org.apache.avalon.framework.component.Composable;
  -import org.apache.avalon.framework.activity.Disposable;
  -
  -import org.apache.cocoon.ResourceNotFoundException;
  -
  -import org.apache.avalon.framework.configuration.Configuration;
  +import org.apache.cocoon.Processor;
  +import org.apache.cocoon.components.treeprocessor.InvokeContext;
  +import org.apache.cocoon.components.treeprocessor.ProcessingNode;
  +import org.apache.cocoon.components.treeprocessor.SimpleParentProcessingNode;
   import org.apache.cocoon.environment.Environment;
   import org.apache.cocoon.environment.ForwardRedirector;
   import org.apache.cocoon.environment.Redirector;
  -import org.apache.cocoon.components.treeprocessor.SimpleParentProcessingNode;
  -import org.apache.cocoon.components.treeprocessor.ProcessingNode;
  -import org.apache.cocoon.components.treeprocessor.InvokeContext;
  -import org.apache.cocoon.Processor;
   
  -import java.util.*;
  -import org.apache.avalon.framework.component.ComponentException;
  +import java.util.Map;
   
   /**
    * Handles <map:pipelines>
  
  
  
  1.2       +1 -2      xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/ViewNodeBuilder.java
  
  Index: ViewNodeBuilder.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/ViewNodeBuilder.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ViewNodeBuilder.java	5 Mar 2002 08:26:23 -0000	1.1
  +++ ViewNodeBuilder.java	11 Sep 2002 10:08:35 -0000	1.2
  @@ -85,7 +85,6 @@
                   label = SitemapLanguage.LAST_POS_LABEL;
               } else {
                   String msg = "Bad value for 'from-position' at " + config.getLocation();
  -                getLogger().error(msg);
                   throw new ConfigurationException(msg);
               }
           }
  
  
  
  1.2       +2 -2      xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/NullNode.java
  
  Index: NullNode.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/NullNode.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- NullNode.java	5 Mar 2002 08:26:22 -0000	1.1
  +++ NullNode.java	11 Sep 2002 10:08:36 -0000	1.2
  @@ -63,7 +63,7 @@
   
       public final boolean invoke(Environment env, InvokeContext context) throws Exception
{
   
  -        getLogger().debug("Invoke on NullNode at " + getLocation());
  +        getLogger().warn("Invoke on NullNode at " + getLocation());
           return false;
   
       }
  
  
  
  1.7       +1 -3      xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/AbstractProcessingNodeBuilder.java
  
  Index: AbstractProcessingNodeBuilder.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/AbstractProcessingNodeBuilder.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- AbstractProcessingNodeBuilder.java	31 Jul 2002 13:13:26 -0000	1.6
  +++ AbstractProcessingNodeBuilder.java	11 Sep 2002 10:08:36 -0000	1.7
  @@ -127,7 +127,6 @@
                           VariableResolverFactory.getResolver(value, this.manager));
                   } catch(PatternException pe) {
                       String msg = "Invalid pattern '" + value + " at " + child.getLocation();
  -                    getLogger().error(msg, pe);
                       throw new ConfigurationException(msg, pe);
                   }
               }
  @@ -144,7 +143,6 @@
           if (!this.treeBuilder.getNamespace().equals(config.getNamespace()))
           {
               String msg = "Invalid namespace '" + config.getNamespace() + "' at " + config.getLocation();
  -            getLogger().error(msg);
               throw new ConfigurationException(msg);
           }
       }
  
  
  
  1.2       +1 -2      xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/ContainerNodeBuilder.java
  
  Index: ContainerNodeBuilder.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/ContainerNodeBuilder.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ContainerNodeBuilder.java	5 Mar 2002 08:26:22 -0000	1.1
  +++ ContainerNodeBuilder.java	11 Sep 2002 10:08:36 -0000	1.2
  @@ -85,7 +85,6 @@
           ProcessingNode[] children = buildChildNodes(config);
           if (children.length == 0) {
               String msg = "There must be at least one child at " + config.getLocation();
  -            getLogger().error(msg);
               throw new ConfigurationException(msg);
           }
   
  
  
  
  1.13      +19 -28    xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/DefaultTreeBuilder.java
  
  Index: DefaultTreeBuilder.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/DefaultTreeBuilder.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- DefaultTreeBuilder.java	9 Sep 2002 12:00:41 -0000	1.12
  +++ DefaultTreeBuilder.java	11 Sep 2002 10:08:36 -0000	1.13
  @@ -57,41 +57,33 @@
   import org.apache.avalon.excalibur.logger.LogKitManageable;
   import org.apache.avalon.excalibur.logger.LogKitManager;
   import org.apache.avalon.excalibur.pool.Recyclable;
  -
   import org.apache.avalon.framework.activity.Disposable;
   import org.apache.avalon.framework.activity.Initializable;
  -
  -import org.apache.avalon.framework.component.Component;
  -import org.apache.avalon.framework.component.ComponentManager;
   import org.apache.avalon.framework.component.ComponentException;
  +import org.apache.avalon.framework.component.ComponentManager;
   import org.apache.avalon.framework.component.ComponentSelector;
   import org.apache.avalon.framework.component.Recomposable;
  -
   import org.apache.avalon.framework.configuration.Configurable;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
  -import org.apache.avalon.framework.configuration.DefaultConfiguration;
   import org.apache.avalon.framework.configuration.NamespacedSAXConfigurationHandler;
  -
   import org.apache.avalon.framework.context.Context;
  -import org.apache.avalon.framework.context.Contextualizable;
   import org.apache.avalon.framework.context.ContextException;
  -
  +import org.apache.avalon.framework.context.Contextualizable;
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
   import org.apache.cocoon.ProcessingException;
   import org.apache.cocoon.components.ExtendedComponentSelector;
   import org.apache.cocoon.components.LifecycleHelper;
   import org.apache.cocoon.components.source.SourceUtil;
  -import org.apache.cocoon.components.treeprocessor.variables.VariableResolver;
   import org.apache.cocoon.components.treeprocessor.variables.VariableResolverFactory;
  -import org.apache.cocoon.environment.SourceResolver;
  -import org.apache.excalibur.source.Source;
  -import org.apache.excalibur.source.SourceException;
  -
   import org.apache.cocoon.sitemap.PatternException;
  -import org.apache.cocoon.util.ClassUtils;
  +import org.apache.excalibur.source.Source;
   
  -import java.util.*;
  +import java.util.ArrayList;
  +import java.util.HashMap;
  +import java.util.Iterator;
  +import java.util.List;
  +import java.util.Map;
   
   /**
    *
  @@ -186,11 +178,16 @@
           this.parentRoleManager = rm;
       }
   
  +    /**
  +     * Configurable
  +     */
       public void configure(Configuration config) throws ConfigurationException {
           this.configuration = config;
   
           this.languageName = config.getAttribute("name");
  -        getLogger().debug("Configuring Builder for language : " + this.languageName);
  +        if (this.getLogger().isDebugEnabled()) {
  +            getLogger().debug("Configuring Builder for language : " + this.languageName);
  +        }
   
           this.fileName = config.getChild("file").getAttribute("name");
   
  @@ -317,7 +314,9 @@
           //FIXME : check namespace
           String nodeName = config.getName();
   
  -        getLogger().debug("Creating node builder for " + nodeName);
  +        if (this.getLogger().isDebugEnabled()) {
  +            getLogger().debug("Creating node builder for " + nodeName);
  +        }
   
           ProcessingNodeBuilder builder;
           try {
  @@ -331,7 +330,6 @@
               } else {
                   // Throw a more meaningfull exception
                   String msg = "Unkown element '" + nodeName + "' at " + config.getLocation();
  -                getLogger().error(msg);
                   throw new ConfigurationException(msg);
               }
           }
  @@ -392,10 +390,8 @@
               return build(treeConfig);
   
           } catch(Exception e) {
  -            getLogger().error("Failed to load " + this.languageName + " from " +
  +            throw new ProcessingException("Failed to load " + this.languageName + " from
" +
                   source.getSystemId(), e);
  -
  -            throw e;
           }
       }
   
  @@ -524,7 +520,6 @@
           }
           catch(PatternException pe) {
               String msg = "Invalid pattern '" + expression + "' at " + config.getLocation();
  -            getLogger().error(msg, pe);
               throw new ConfigurationException(msg, pe);
           }
   
  @@ -559,7 +554,6 @@
                           VariableResolverFactory.getResolver(value, this.manager));
                   } catch(PatternException pe) {
                       String msg = "Invalid pattern '" + value + "' at " + child.getLocation();
  -                    getLogger().error(msg, pe);
                       throw new ConfigurationException(msg, pe);
                   }
               }
  @@ -587,7 +581,6 @@
               } catch(ComponentException ce) {
                   String msg = "Cannot get component selector for '" + statement.getName()
+ "' at " +
                       statement.getLocation();
  -                getLogger().error(msg, ce);
                   throw new ConfigurationException(msg, ce);
               }
   
  @@ -598,14 +591,12 @@
               if (type == null) {
                   String msg = "No default type exists for '" + statement.getName() + "'
at " +
                       statement.getLocation();
  -                getLogger().error(msg);
                   throw new ConfigurationException(msg);
               }
   
               if (!selector.hasComponent(type)) {
                   String msg = "Type '" + type + "' is not defined for '" + statement.getName()
+ "' at " +
                       statement.getLocation();
  -                getLogger().error(msg);
                   throw new ConfigurationException(msg);
               }
           } finally {
  
  
  
  1.22      +1 -2      xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/TreeProcessor.java
  
  Index: TreeProcessor.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/TreeProcessor.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- TreeProcessor.java	9 Aug 2002 08:40:31 -0000	1.21
  +++ TreeProcessor.java	11 Sep 2002 10:08:36 -0000	1.22
  @@ -266,7 +266,6 @@
               }
           } catch(Exception e) {
               String msg = "Error while reading " + xconfURL + ": " + e.getMessage();
  -            getLogger().error(msg, e);
               throw new ConfigurationException(msg, e);
           } finally {
               this.manager.release( resolver );
  
  
  
  1.3       +1 -3      xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/CategoryNode.java
  
  Index: CategoryNode.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/CategoryNode.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- CategoryNode.java	29 Apr 2002 14:46:16 -0000	1.2
  +++ CategoryNode.java	11 Sep 2002 10:08:36 -0000	1.3
  @@ -77,7 +77,6 @@
   
       public final boolean invoke(Environment env, InvokeContext context) throws Exception
{
           String msg = "Cannot invoke " + this.categoryName + " at " + getLocation();
  -        getLogger().error(msg);
           throw new ProcessingException(msg);
       }
   
  @@ -85,7 +84,6 @@
           ProcessingNode node = (ProcessingNode)nodes.get(name);
           if (node == null) {
               String msg = "Unknown " + this.categoryName + " named '" + name + "' at " +
getLocation();
  -            getLogger().error(msg);
               throw new ProcessingException(msg);
           }
   
  
  
  
  1.3       +5 -6      xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/AbstractParentProcessingNodeBuilder.java
  
  Index: AbstractParentProcessingNodeBuilder.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/AbstractParentProcessingNodeBuilder.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AbstractParentProcessingNodeBuilder.java	31 Jul 2002 13:13:26 -0000	1.2
  +++ AbstractParentProcessingNodeBuilder.java	11 Sep 2002 10:08:36 -0000	1.3
  @@ -104,8 +104,10 @@
   
           // Is this element to be ignored ?
           if (ignoredChildren != null && ignoredChildren.contains(name)) {
  -            getLogger().debug("Element '" + name + "' is ignored for building children
of element '" +
  -                child.getName() + "'");
  +            if (this.getLogger().isDebugEnabled()) {
  +                getLogger().debug("Element '" + name + "' is ignored for building children
of element '" +
  +                    child.getName() + "'");
  +            }
   
               return false;
           }
  @@ -114,7 +116,6 @@
           if ( (allowedChildren != null && !allowedChildren.contains(name)) ||
                (forbiddenChildren != null && forbiddenChildren.contains(name)) )
{
               String msg = "Element '" + name + "' is not allowed at " + child.getLocation();
  -            getLogger().error(msg);
               throw new ConfigurationException(msg);
           }
   
  @@ -128,7 +129,6 @@
                   return true;
               } else {
                   String msg = "Element '" + name + "' has no parameters at " + config.getLocation();
  -                getLogger().error(msg);
                   throw new ConfigurationException(msg);
               }
           }
  @@ -158,7 +158,6 @@
                   throw ce;
               } catch(Exception e) {
                   String msg = "Error while creating node '" + child.getName() + "' at "
+ child.getLocation();
  -                getLogger().error(msg, e);
                   throw new ConfigurationException(msg, e);
               }
           }
  
  
  
  1.35      +14 -27    xml-cocoon2/src/java/org/apache/cocoon/Cocoon.java
  
  Index: Cocoon.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/Cocoon.java,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- Cocoon.java	6 Sep 2002 02:49:08 -0000	1.34
  +++ Cocoon.java	11 Sep 2002 10:08:36 -0000	1.35
  @@ -191,10 +191,8 @@
                   );
   
               } catch (IOException ioe) {
  -                getLogger().error("Could not open configuration file.", ioe);
                   throw new ContextException("Could not open configuration file.", ioe);
               } catch (Exception e) {
  -                getLogger().error("contextualize(..) Exception", e);
                   throw new ContextException("contextualize(..) Exception", e);
               }
           }
  @@ -258,7 +256,6 @@
           try {
               startupManager.addComponent(Parser.ROLE, ClassUtils.loadClass(parser), new
org.apache.avalon.framework.configuration.DefaultConfiguration("", "empty"));
           } catch (Exception e) {
  -            getLogger().error("Could not load parser, Cocoon object not created.", e);
               throw new ConfigurationException("Could not load parser " + parser, e);
           }
   
  @@ -295,23 +292,19 @@
   
       /** Dump System Properties */
       private void dumpSystemProperties() {
  -      try {
  -         Enumeration e = System.getProperties().propertyNames();
  -         if (getLogger().isDebugEnabled()) {
  -             getLogger().debug("===== System Properties Start =====");
  -         }
  -         for (;e.hasMoreElements();) {
  -            String key = (String) e.nextElement();
  -            if (getLogger().isDebugEnabled()) {
  -                getLogger().debug(key + "=" + System.getProperty(key));
  +        if (getLogger().isDebugEnabled()) {
  +            try {
  +                Enumeration e = System.getProperties().propertyNames();
  +                getLogger().debug("===== System Properties Start =====");
  +                for (; e.hasMoreElements();) {
  +                    String key = (String) e.nextElement();
  +                    getLogger().debug(key + "=" + System.getProperty(key));
  +                }
  +                getLogger().debug("===== System Properties End =====");
  +            } catch (SecurityException se) {
  +                // Ignore Exceptions.
               }
  -         }
  -         if (getLogger().isDebugEnabled()) {
  -             getLogger().debug("===== System Properties End =====");
  -         }
  -       } catch ( SecurityException se ) {
  -         // Ignore Exceptions.
  -       }
  +        }
       }
   
       /**
  @@ -336,7 +329,6 @@
               p.parse(is, b);
               roleConfig = b.getConfiguration();
           } catch (Exception e) {
  -            getLogger().error("Could not configure Cocoon environment", e);
               throw new ConfigurationException("Error trying to load configurations", e);
           } finally {
               if (p != null) startupManager.release(p);
  @@ -354,7 +346,6 @@
               p.parse(is, b);
               this.configuration = b.getConfiguration();
           } catch (Exception e) {
  -            getLogger().error("Could not configure Cocoon environment", e);
               throw new ConfigurationException("Error trying to load configurations",e);
           } finally {
               if (p != null) startupManager.release(p);
  @@ -390,7 +381,6 @@
                   p.parse(is, b);
                   roleConfig = b.getConfiguration();
               } catch (Exception e) {
  -                getLogger().error("Could not configure Cocoon environment with user roles
file", e);
                   throw new ConfigurationException("Error trying to load user-roles configuration",
e);
               } finally {
                   startupManager.release(p);
  @@ -443,7 +433,7 @@
           }
           // FIXME We shouldn't have to specify these. Needed to override jaxp implementation
of weblogic.
           if (systemProps.containsKey("javax.xml.parsers.DocumentBuilderFactory") &&
  -           systemProps.getProperty("javax.xml.parsers.DocumentBuilderFactory").startsWith("weblogic"))
{
  +            systemProps.getProperty("javax.xml.parsers.DocumentBuilderFactory").startsWith("weblogic"))
{
               systemProps.put("javax.xml.parsers.DocumentBuilderFactory", "org.apache.xerces.jaxp.DocumentBuilderFactoryImpl");
               systemProps.put("javax.xml.parsers.SAXParserFactory","org.apache.xerces.jaxp.SAXParserFactoryImpl");
           }
  @@ -692,9 +682,6 @@
                   getLogger().debug("XSP generation complete:" + xsp);
               }
               this.componentManager.release(programGenerator);
  -        } catch (Exception e) {
  -            getLogger().error("Main: Error compiling XSP", e);
  -            throw e;
           } finally {
               this.componentManager.release(programGenerator);
           }
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message