incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r688682 - in /incubator/sling/trunk/engine/src/main/java/org/apache/sling/engine/impl: SlingMainServlet.java filter/AbstractSlingFilterChain.java request/RequestData.java request/SlingRequestDispatcher.java request/SlingRequestPathInfo.java
Date Mon, 25 Aug 2008 09:33:27 GMT
Author: fmeschbe
Date: Mon Aug 25 02:33:27 2008
New Revision: 688682

URL: http://svn.apache.org/viewvc?rev=688682&view=rev
Log:
SLING-613 Apply slightly modified patch with the following extensions:
  * More log tracking (filter application, resource path info)
  * Dump the request progress tracker in the default error handler

Modified:
    incubator/sling/trunk/engine/src/main/java/org/apache/sling/engine/impl/SlingMainServlet.java
    incubator/sling/trunk/engine/src/main/java/org/apache/sling/engine/impl/filter/AbstractSlingFilterChain.java
    incubator/sling/trunk/engine/src/main/java/org/apache/sling/engine/impl/request/RequestData.java
    incubator/sling/trunk/engine/src/main/java/org/apache/sling/engine/impl/request/SlingRequestDispatcher.java
    incubator/sling/trunk/engine/src/main/java/org/apache/sling/engine/impl/request/SlingRequestPathInfo.java

Modified: incubator/sling/trunk/engine/src/main/java/org/apache/sling/engine/impl/SlingMainServlet.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/engine/src/main/java/org/apache/sling/engine/impl/SlingMainServlet.java?rev=688682&r1=688681&r2=688682&view=diff
==============================================================================
--- incubator/sling/trunk/engine/src/main/java/org/apache/sling/engine/impl/SlingMainServlet.java
(original)
+++ incubator/sling/trunk/engine/src/main/java/org/apache/sling/engine/impl/SlingMainServlet.java
Mon Aug 25 02:33:27 2008
@@ -52,6 +52,7 @@
 import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.SlingHttpServletResponse;
 import org.apache.sling.api.request.RequestPathInfo;
+import org.apache.sling.api.request.RequestProgressTracker;
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceNotFoundException;
 import org.apache.sling.api.resource.ResourceResolver;
@@ -272,7 +273,9 @@
             if (filters != null) {
                 FilterChain processor = new RequestSlingFilterChain(this,
                     filters);
-
+                
+                request.getRequestProgressTracker().log("Applying request filters");
+                
                 processor.doFilter(request, response);
 
             } else {
@@ -433,6 +436,8 @@
         if (filters != null) {
             FilterChain processor = new SlingComponentFilterChain(filters);
 
+            request.getRequestProgressTracker().log("Applying inner filters");
+            
             processor.doFilter(request, response);
         } else {
             log.debug("service: No Resource level filters, calling servlet");
@@ -507,9 +512,16 @@
             pw.println("</p>");
 
             if (throwable != null) {
+                pw.println("<h3>Exception stacktrace:</h3>");
                 pw.println("<pre>");
                 throwable.printStackTrace(pw);
                 pw.println("</pre>");
+                
+                RequestProgressTracker tracker = ((SlingHttpServletRequest) request).getRequestProgressTracker();
+                pw.println("<h3>Request Progress:</h3>");
+                pw.println("<pre>");
+                tracker.dump(pw);
+                pw.println("</pre>");
             }
 
             pw.println("<hr /><address>");
@@ -755,7 +767,7 @@
         }
         return stringConfig;
     }
-
+    
     //---------- HttpContext interface ----------------------------------------
 
     public String getMimeType(String name) {

Modified: incubator/sling/trunk/engine/src/main/java/org/apache/sling/engine/impl/filter/AbstractSlingFilterChain.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/engine/src/main/java/org/apache/sling/engine/impl/filter/AbstractSlingFilterChain.java?rev=688682&r1=688681&r2=688682&view=diff
==============================================================================
--- incubator/sling/trunk/engine/src/main/java/org/apache/sling/engine/impl/filter/AbstractSlingFilterChain.java
(original)
+++ incubator/sling/trunk/engine/src/main/java/org/apache/sling/engine/impl/filter/AbstractSlingFilterChain.java
Mon Aug 25 02:33:27 2008
@@ -28,6 +28,7 @@
 
 import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.SlingHttpServletResponse;
+import org.apache.sling.api.request.RequestProgressTracker;
 
 public abstract class AbstractSlingFilterChain implements FilterChain {
 
@@ -49,6 +50,10 @@
         this.current++;
 
         if (this.current < this.filters.length) {
+            
+            RequestProgressTracker tracker = ((SlingHttpServletRequest) request).getRequestProgressTracker();
+            tracker.log("Calling filter: {0}", this.filters[this.current].getClass().getName());
+            
             this.filters[this.current].doFilter(request, response, this);
         } else {
             this.render((SlingHttpServletRequest) request,

Modified: incubator/sling/trunk/engine/src/main/java/org/apache/sling/engine/impl/request/RequestData.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/engine/src/main/java/org/apache/sling/engine/impl/request/RequestData.java?rev=688682&r1=688681&r2=688682&view=diff
==============================================================================
--- incubator/sling/trunk/engine/src/main/java/org/apache/sling/engine/impl/request/RequestData.java
(original)
+++ incubator/sling/trunk/engine/src/main/java/org/apache/sling/engine/impl/request/RequestData.java
Mon Aug 25 02:33:27 2008
@@ -155,6 +155,8 @@
             getServletRequest().getPathInfo());
         ContentData contentData = pushContent(resource, requestPathInfo);
 
+	    requestProgressTracker.log("Resource Path Info: {0}", requestPathInfo);
+
         // finally resolve the servlet for the resource
         ServletResolver sr = slingMainServlet.getServletResolver();
         if (sr != null) {
@@ -162,7 +164,7 @@
             Servlet servlet = sr.resolveServlet(slingRequest);
             requestProgressTracker.logTimer("ServletResolution",
                 "URI={0} handled by Servlet={1}",
-                getServletRequest().getRequestURI(), servlet.getServletInfo());
+                getServletRequest().getRequestURI(), RequestUtil.getServletName(servlet));
             contentData.setServlet(servlet);
         } else {
             log.warn("init(): No ServletResolver available");

Modified: incubator/sling/trunk/engine/src/main/java/org/apache/sling/engine/impl/request/SlingRequestDispatcher.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/engine/src/main/java/org/apache/sling/engine/impl/request/SlingRequestDispatcher.java?rev=688682&r1=688681&r2=688682&view=diff
==============================================================================
--- incubator/sling/trunk/engine/src/main/java/org/apache/sling/engine/impl/request/SlingRequestDispatcher.java
(original)
+++ incubator/sling/trunk/engine/src/main/java/org/apache/sling/engine/impl/request/SlingRequestDispatcher.java
Mon Aug 25 02:33:27 2008
@@ -119,7 +119,7 @@
             }
         }
 
-        cRequest.getRequestProgressTracker().log("Including resource " + info.getResourcePath());
+        cRequest.getRequestProgressTracker().log("Including resource {0} ({1})", resource,
info);
         rd.getSlingMainServlet().includeContent(request, response, resource,
             info);
     }

Modified: incubator/sling/trunk/engine/src/main/java/org/apache/sling/engine/impl/request/SlingRequestPathInfo.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/engine/src/main/java/org/apache/sling/engine/impl/request/SlingRequestPathInfo.java?rev=688682&r1=688681&r2=688682&view=diff
==============================================================================
--- incubator/sling/trunk/engine/src/main/java/org/apache/sling/engine/impl/request/SlingRequestPathInfo.java
(original)
+++ incubator/sling/trunk/engine/src/main/java/org/apache/sling/engine/impl/request/SlingRequestPathInfo.java
Mon Aug 25 02:33:27 2008
@@ -164,7 +164,7 @@
 
     @Override
     public String toString() {
-        return "SlingRequestPathInfoParser:" + ", path='" + resourcePath + "'"
+        return "SlingRequestPathInfo: path='" + resourcePath + "'"
             + ", selectorString='" + selectorString + "'" + ", extension='"
             + extension + "'" + ", suffix='" + suffix + "'";
     }



Mime
View raw message