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 <[email protected]> Authored: Tue Jun 17 11:00:23 2014 -0700 Committer: Howard M. Lewis Ship <[email protected]> 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;
