You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by hl...@apache.org on 2014/06/17 20:04:07 UTC

[1/2] git commit: Consolidate the two ExceptionReporter interfaces into just the single existing one

Repository: tapestry-5
Updated Branches:
  refs/heads/master d3bc1f1b8 -> 4780b04b5


Consolidate the two ExceptionReporter interfaces into just the single existing one


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/b2c2fff4
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/b2c2fff4
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/b2c2fff4

Branch: refs/heads/master
Commit: b2c2fff485b734abdd72b0880737d97315bad9ea
Parents: d3bc1f1
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Tue Jun 17 11:00:23 2014 -0700
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Tue Jun 17 11:02:07 2014 -0700

----------------------------------------------------------------------
 .../DefaultRequestExceptionHandler.java         |  4 +--
 .../exceptions/ExceptionReporterImpl.java       |  2 +-
 .../tapestry5/modules/TapestryModule.java       |  2 +-
 .../tapestry5/services/ExceptionReporter.java   | 13 ++++++--
 .../services/exceptions/ExceptionReporter.java  | 33 --------------------
 .../DefaultRequestExceptionHandlerTest.java     |  2 +-
 6 files changed, 15 insertions(+), 41 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/b2c2fff4/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/DefaultRequestExceptionHandler.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/DefaultRequestExceptionHandler.java b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/DefaultRequestExceptionHandler.java
index de6b50b..4ae362c 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/DefaultRequestExceptionHandler.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/DefaultRequestExceptionHandler.java
@@ -69,7 +69,7 @@ public class DefaultRequestExceptionHandler implements RequestExceptionHandler
 
     private final LinkSource linkSource;
 
-    private final org.apache.tapestry5.services.exceptions.ExceptionReporter exceptionReporter;
+    private final ExceptionReporter exceptionReporter;
 
     // should be Class<? extends Throwable>, Object but it's not allowed to configure subtypes
     private final Map<Class, Object> configuration;
@@ -89,7 +89,7 @@ public class DefaultRequestExceptionHandler implements RequestExceptionHandler
                                           ComponentClassResolver componentClassResolver,
                                           LinkSource linkSource,
                                           ServiceResources serviceResources,
-                                          org.apache.tapestry5.services.exceptions.ExceptionReporter exceptionReporter,
+                                          ExceptionReporter exceptionReporter,
                                           Map<Class, Object> configuration)
     {
         this.pageCache = pageCache;

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/b2c2fff4/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/exceptions/ExceptionReporterImpl.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/exceptions/ExceptionReporterImpl.java b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/exceptions/ExceptionReporterImpl.java
index 7afc773..06ba0d4 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/exceptions/ExceptionReporterImpl.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/exceptions/ExceptionReporterImpl.java
@@ -27,9 +27,9 @@ import org.apache.tapestry5.ioc.services.ExceptionAnalysis;
 import org.apache.tapestry5.ioc.services.ExceptionAnalyzer;
 import org.apache.tapestry5.ioc.services.ExceptionInfo;
 import org.apache.tapestry5.ioc.util.ExceptionUtils;
+import org.apache.tapestry5.services.ExceptionReporter;
 import org.apache.tapestry5.services.Request;
 import org.apache.tapestry5.services.RequestGlobals;
-import org.apache.tapestry5.services.exceptions.ExceptionReporter;
 import org.slf4j.Logger;
 
 import java.io.File;

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/b2c2fff4/tapestry-core/src/main/java/org/apache/tapestry5/modules/TapestryModule.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/modules/TapestryModule.java b/tapestry-core/src/main/java/org/apache/tapestry5/modules/TapestryModule.java
index aa965ad..a9abd4b 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/modules/TapestryModule.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/modules/TapestryModule.java
@@ -374,7 +374,7 @@ public final class TapestryModule
         binder.bind(PathConstructor.class, PathConstructorImpl.class);
         binder.bind(DateUtilities.class, DateUtilitiesImpl.class);
         binder.bind(PartialTemplateRenderer.class, PartialTemplateRendererImpl.class);
-        binder.bind(org.apache.tapestry5.services.exceptions.ExceptionReporter.class, ExceptionReporterImpl.class);
+        binder.bind(ExceptionReporter.class, ExceptionReporterImpl.class);
         binder.bind(ComponentOverride.class, ComponentOverrideImpl.class).eagerLoad();
     }
 

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/b2c2fff4/tapestry-core/src/main/java/org/apache/tapestry5/services/ExceptionReporter.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/services/ExceptionReporter.java b/tapestry-core/src/main/java/org/apache/tapestry5/services/ExceptionReporter.java
index f620838..582f849 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/services/ExceptionReporter.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/services/ExceptionReporter.java
@@ -1,5 +1,3 @@
-// Copyright 2006, 2007 The Apache Software Foundation
-//
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
 // You may obtain a copy of the License at
@@ -16,7 +14,16 @@ package org.apache.tapestry5.services;
 
 /**
  * Interface implemented by a page used for reporting exceptions.
+ * <p/>
+ * Alternately,  implemented by services to report request handling exceptions. This is invoked <em>before</em> the exception report page is rendered.
+ * The default implementation converts the exception into a well formatted text file, with content similar to the default
+ * {@link org.apache.tapestry5.corelib.pages.ExceptionReport} page, and stores this file on the file system.
+ * <p/>
+ * Exception report files are stored beneath a root directory, with intermediate folders for the day (e.g., "2014-06-02"), hour, and minute.
+ * <p/>
+ * Directories are created as necessary; however, there is nothing in place to delete these exceptions reports.
  *
+ * @see org.apache.tapestry5.SymbolConstants#EXCEPTION_REPORTS_DIR
  * @see org.apache.tapestry5.services.RequestExceptionHandler
  */
 public interface ExceptionReporter
@@ -27,4 +34,4 @@ public interface ExceptionReporter
      * @param exception runtime exception thrown during processing of the request
      */
     void reportException(Throwable exception);
-}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/b2c2fff4/tapestry-core/src/main/java/org/apache/tapestry5/services/exceptions/ExceptionReporter.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/services/exceptions/ExceptionReporter.java b/tapestry-core/src/main/java/org/apache/tapestry5/services/exceptions/ExceptionReporter.java
deleted file mode 100644
index 3ffd92b..0000000
--- a/tapestry-core/src/main/java/org/apache/tapestry5/services/exceptions/ExceptionReporter.java
+++ /dev/null
@@ -1,33 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package org.apache.tapestry5.services.exceptions;
-
-/**
- * Services used to report request handling exceptions. This is invoked <em>before</em> the exception report page is rendered.
- * The default implementation converts the exception into a well formatted text file, with content similar to the default
- * {@link org.apache.tapestry5.corelib.pages.ExceptionReport} page, and stores this file on the file system.
- * <p/>
- * Exception report files are stored beneath a root directory, with intermediate folders for the day (e.g., "2014-06-02"), hour, and minute.
- * <p/>
- * Directories are created as necessary; however, there is nothing in place to delete these exceptions reports.
- *
- * @see org.apache.tapestry5.SymbolConstants#EXCEPTION_REPORTS_DIR
- * @since 5.4
- */
-public interface ExceptionReporter
-{
-    /**
-     * Records the exception.
-     */
-    void reportException(Throwable exception);
-}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/b2c2fff4/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/DefaultRequestExceptionHandlerTest.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/DefaultRequestExceptionHandlerTest.java b/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/DefaultRequestExceptionHandlerTest.java
index ddab492..ed9517c 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/DefaultRequestExceptionHandlerTest.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/DefaultRequestExceptionHandlerTest.java
@@ -18,9 +18,9 @@ import org.apache.tapestry5.Link;
 import org.apache.tapestry5.internal.test.InternalBaseTestCase;
 import org.apache.tapestry5.ioc.ServiceResources;
 import org.apache.tapestry5.services.ComponentClassResolver;
+import org.apache.tapestry5.services.ExceptionReporter;
 import org.apache.tapestry5.services.Request;
 import org.apache.tapestry5.services.Response;
-import org.apache.tapestry5.services.exceptions.ExceptionReporter;
 import org.easymock.EasyMock;
 import org.slf4j.Logger;
 import org.testng.annotations.BeforeMethod;


[2/2] git commit: Write the remoteHost property to the exception report file

Posted by hl...@apache.org.
Write the remoteHost property to the exception report file


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/4780b04b
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/4780b04b
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/4780b04b

Branch: refs/heads/master
Commit: 4780b04b5c2bdebbd3f4f96691e3f15727b5cb09
Parents: b2c2fff
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Tue Jun 17 11:04:01 2014 -0700
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Tue Jun 17 11:04:01 2014 -0700

----------------------------------------------------------------------
 .../internal/services/exceptions/ExceptionReporterImpl.java         | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/4780b04b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/exceptions/ExceptionReporterImpl.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/exceptions/ExceptionReporterImpl.java b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/exceptions/ExceptionReporterImpl.java
index 06ba0d4..6a9bfad 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/exceptions/ExceptionReporterImpl.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/exceptions/ExceptionReporterImpl.java
@@ -270,6 +270,7 @@ public class ExceptionReporterImpl implements ExceptionReporter
             pw.write("path", request.getPath());
             pw.write("locale", request.getLocale());
             pw.write("serverName", request.getServerName());
+            pw.write("remoteHost", request.getRemoteHost());
             writer.print("\nHeaders:\n");
             for (String name : request.getHeaderNames())
             {


[2/2] git commit: Write the remoteHost property to the exception report file

Posted by hl...@apache.org.
Write the remoteHost property to the exception report file


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/4780b04b
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/4780b04b
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/4780b04b

Branch: refs/heads/master
Commit: 4780b04b5c2bdebbd3f4f96691e3f15727b5cb09
Parents: b2c2fff
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Tue Jun 17 11:04:01 2014 -0700
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Tue Jun 17 11:04:01 2014 -0700

----------------------------------------------------------------------
 .../internal/services/exceptions/ExceptionReporterImpl.java         | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/4780b04b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/exceptions/ExceptionReporterImpl.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/exceptions/ExceptionReporterImpl.java b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/exceptions/ExceptionReporterImpl.java
index 06ba0d4..6a9bfad 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/exceptions/ExceptionReporterImpl.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/exceptions/ExceptionReporterImpl.java
@@ -270,6 +270,7 @@ public class ExceptionReporterImpl implements ExceptionReporter
             pw.write("path", request.getPath());
             pw.write("locale", request.getLocale());
             pw.write("serverName", request.getServerName());
+            pw.write("remoteHost", request.getRemoteHost());
             writer.print("\nHeaders:\n");
             for (String name : request.getHeaderNames())
             {