net.databinder
Class ExceptionFilteringRequestCycle

java.lang.Object
  extended by org.apache.wicket.RequestCycle
      extended by org.apache.wicket.protocol.http.WebRequestCycle
          extended by net.databinder.ExceptionFilteringRequestCycle
Direct Known Subclasses:
CookieRequestCycle

public abstract class ExceptionFilteringRequestCycle
extends org.apache.wicket.protocol.http.WebRequestCycle

Request cycle that logs runtime exceptions as warnings if their origin matches a pattern. RequestCycle logs any uncaught exception as an error.

Author:
Nathan Hamblen

Field Summary
 
Fields inherited from class org.apache.wicket.RequestCycle
application, processor, request, response
 
Constructor Summary
ExceptionFilteringRequestCycle(org.apache.wicket.protocol.http.WebApplication application, org.apache.wicket.protocol.http.WebRequest request, org.apache.wicket.Response response)
           
 
Method Summary
protected  void logRuntimeException(java.lang.RuntimeException e)
          Logs runtime exception as warning if it matches the warnOnlySource pattern.
static void setWarnOnlySource(java.util.regex.Pattern pattern)
          Change the warn testing pattern used by all instances of this class.
 
Methods inherited from class org.apache.wicket.protocol.http.WebRequestCycle
getProcessor, getWebRequest, getWebResponse, getWebSession, isRedirect, newClientInfo, redirectTo
 
Methods inherited from class org.apache.wicket.RequestCycle
detach, get, getApplication, getClientInfo, getMetaData, getOriginalResponse, getPageParameters, getRedirect, getRequest, getRequestTarget, getResponse, getResponsePage, getResponsePageClass, getSession, getStartTime, isUrlForNewWindowEncoding, onBeginRequest, onEndRequest, onRuntimeException, request, request, request, set, setAutomaticallyClearFeedbackMessages, setMetaData, setRedirect, setRequest, setRequestTarget, setResponse, setResponsePage, setResponsePage, setResponsePage, setResponsePage, setUrlForNewWindowEncoding, toString, urlFor, urlFor, urlFor, urlFor, urlFor, urlFor, urlFor, urlFor, urlFor, wasHandled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExceptionFilteringRequestCycle

public ExceptionFilteringRequestCycle(org.apache.wicket.protocol.http.WebApplication application,
                                      org.apache.wicket.protocol.http.WebRequest request,
                                      org.apache.wicket.Response response)
Method Detail

logRuntimeException

protected void logRuntimeException(java.lang.RuntimeException e)
Logs runtime exception as warning if it matches the warnOnlySource pattern. Passes to super otherwise.

Overrides:
logRuntimeException in class org.apache.wicket.RequestCycle

setWarnOnlySource

public static void setWarnOnlySource(java.util.regex.Pattern pattern)
Change the warn testing pattern used by all instances of this class. An exception thrown by a class (found by stack trace) matching this pattern is logged as a warning. Set this to null to disable filtering and log all exceptions in super.

Parameters:
pattern - to match against fully qualified class name of exception origin


Copyright © 2005-2008 Nathan Hamblen. All Rights Reserved.