Author: niallp
Date: Tue May 20 13:49:32 2008
New Revision: 658422

URL: http://svn.apache.org/viewvc?rev=658422&view=rev
Log:
Add some debugging to ChainListener

Modified:
    
commons/proper/chain/trunk/src/java/org/apache/commons/chain/web/ChainListener.java

Modified: 
commons/proper/chain/trunk/src/java/org/apache/commons/chain/web/ChainListener.java
URL: 
http://svn.apache.org/viewvc/commons/proper/chain/trunk/src/java/org/apache/commons/chain/web/ChainListener.java?rev=658422&r1=658421&r2=658422&view=diff
==============================================================================
--- 
commons/proper/chain/trunk/src/java/org/apache/commons/chain/web/ChainListener.java
 (original)
+++ 
commons/proper/chain/trunk/src/java/org/apache/commons/chain/web/ChainListener.java
 Tue May 20 13:49:32 2008
@@ -208,13 +208,13 @@
 
         // Parse the resources specified in our init parameters (if any)
         if (attr == null) {
-            parseJarResources(context, parser);
+            parseJarResources(context, parser, log);
             ChainResources.parseClassResources
                 (classResources, parser);
             ChainResources.parseWebResources
                 (context, webResources, parser);
         } else {
-            parseJarResources(catalog, context, parser);
+            parseJarResources(catalog, context, parser, log);
             ChainResources.parseClassResources
                 (catalog, classResources, parser);
             ChainResources.parseWebResources
@@ -240,7 +240,7 @@
      * @param parser [EMAIL PROTECTED] ConfigParser} to use for parsing
      */
     private void parseJarResources(ServletContext context,
-                                   ConfigParser parser) {
+                                   ConfigParser parser, Log log) {
 
         Set jars = context.getResourcePaths("/WEB-INF/lib");
         if (jars == null) {
@@ -270,10 +270,16 @@
                       // means there is no such resource
                 }
                 if (is == null) {
+                    if (log.isDebugEnabled()) {
+                        log.debug("Not Found: " + resourceURL);
+                    }
                     continue;
                 } else {
                     is.close();
                 }
+                if (log.isDebugEnabled()) {
+                    log.debug("Parsing: " + resourceURL);
+                }
                 parser.parse(resourceURL);
             } catch (Exception e) {
                 throw new RuntimeException
@@ -298,7 +304,7 @@
      *  configuration resource containing "catalog" element(s)
      */
     private void parseJarResources(Catalog catalog, ServletContext context,
-                                   ConfigParser parser) {
+                                   ConfigParser parser, Log log) {
 
         Set jars = context.getResourcePaths("/WEB-INF/lib");
         if (jars == null) {
@@ -328,10 +334,16 @@
                       // means there is no such resource
                 }
                 if (is == null) {
+                    if (log.isDebugEnabled()) {
+                        log.debug("Not Found: " + resourceURL);
+                    }
                     continue;
                 } else {
                     is.close();
                 }
+                if (log.isDebugEnabled()) {
+                    log.debug("Parsing: " + resourceURL);
+                }
                 parser.parse(catalog, resourceURL);
             } catch (Exception e) {
                 throw new RuntimeException


Reply via email to