org.apache.beehive.netui.pageflow.internal
Class DefaultExceptionsHandler

Object
  extended by DefaultHandler
      extended by DefaultExceptionsHandler
All Implemented Interfaces:
Serializable, ExceptionsHandler, Handler

public class DefaultExceptionsHandler
extends DefaultHandler
implements ExceptionsHandler

See Also:
Serialized Form

Constructor Summary
DefaultExceptionsHandler()
           
 
Method Summary
 void exposeException(Throwable ex, ActionMapping actionMapping, HttpServletRequest request, HttpServletResponse response, ServletContext servletContext)
           
protected  ExceptionConfig getAlternateExceptionConfig(Class exClass, FlowController originalFlowController, HttpServletRequest request, ServletContext servletContext)
           
protected  FlowController getAlternateFlowController(FlowController originalFlowController, HttpServletRequest request, HttpServletResponse response, ServletContext servletContext)
           
protected  ExceptionConfig getExceptionConfig(Class exceptionType, ModuleConfig moduleConfig)
           
protected  Method getExceptionHandlerMethod(String methodName, Throwable ex, Object formBean, FlowController flowController)
          Get an Exception handler method.
protected  String getMessage(String messageKey, String bundle, Object[] args, HttpServletRequest request, ServletContext servletContext, FlowController flowController)
           
 ActionForward handleException(Throwable ex, ActionMapping actionMapping, String actionName, ActionForm form, FlowController flowController, HttpServletRequest request, HttpServletResponse response, ServletContext servletContext)
           
protected  ActionForward invokeExceptionHandlerClass(Throwable throwable, ExceptionConfig exceptionConfig, ActionMapping actionMapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
           
protected  ActionForward invokeExceptionHandlerMethod(Throwable ex, PageFlowExceptionConfig exceptionConfig, ActionForm form, String actionName, ActionMapping actionMapping, FlowController flowController, HttpServletRequest request, HttpServletResponse response, ServletContext servletContext)
           
 void sendUnhandledExceptionError(Throwable ex, HttpServletRequest request, HttpServletResponse response, ServletContext servletContext)
           
 Throwable unwrapException(Throwable ex)
           
 
Methods inherited from class DefaultHandler
getServletContext, init, reinit
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface Handler
init, reinit
 

Constructor Detail

DefaultExceptionsHandler

public DefaultExceptionsHandler()
Method Detail

handleException

public ActionForward handleException(Throwable ex,
                                     ActionMapping actionMapping,
                                     String actionName,
                                     ActionForm form,
                                     FlowController flowController,
                                     HttpServletRequest request,
                                     HttpServletResponse response,
                                     ServletContext servletContext)
                              throws Exception
Specified by:
handleException in interface ExceptionsHandler
Throws:
Exception

unwrapException

public Throwable unwrapException(Throwable ex)
Specified by:
unwrapException in interface ExceptionsHandler

exposeException

public void exposeException(Throwable ex,
                            ActionMapping actionMapping,
                            HttpServletRequest request,
                            HttpServletResponse response,
                            ServletContext servletContext)
Specified by:
exposeException in interface ExceptionsHandler

getExceptionConfig

protected ExceptionConfig getExceptionConfig(Class exceptionType,
                                             ModuleConfig moduleConfig)

getAlternateExceptionConfig

protected ExceptionConfig getAlternateExceptionConfig(Class exClass,
                                                      FlowController originalFlowController,
                                                      HttpServletRequest request,
                                                      ServletContext servletContext)

getAlternateFlowController

protected FlowController getAlternateFlowController(FlowController originalFlowController,
                                                    HttpServletRequest request,
                                                    HttpServletResponse response,
                                                    ServletContext servletContext)

invokeExceptionHandlerClass

protected ActionForward invokeExceptionHandlerClass(Throwable throwable,
                                                    ExceptionConfig exceptionConfig,
                                                    ActionMapping actionMapping,
                                                    ActionForm form,
                                                    HttpServletRequest request,
                                                    HttpServletResponse response)
                                             throws Exception
Throws:
Exception

invokeExceptionHandlerMethod

protected ActionForward invokeExceptionHandlerMethod(Throwable ex,
                                                     PageFlowExceptionConfig exceptionConfig,
                                                     ActionForm form,
                                                     String actionName,
                                                     ActionMapping actionMapping,
                                                     FlowController flowController,
                                                     HttpServletRequest request,
                                                     HttpServletResponse response,
                                                     ServletContext servletContext)
                                              throws Exception
Throws:
Exception

getMessage

protected String getMessage(String messageKey,
                            String bundle,
                            Object[] args,
                            HttpServletRequest request,
                            ServletContext servletContext,
                            FlowController flowController)

sendUnhandledExceptionError

public void sendUnhandledExceptionError(Throwable ex,
                                        HttpServletRequest request,
                                        HttpServletResponse response,
                                        ServletContext servletContext)
Specified by:
sendUnhandledExceptionError in interface ExceptionsHandler

getExceptionHandlerMethod

protected Method getExceptionHandlerMethod(String methodName,
                                           Throwable ex,
                                           Object formBean,
                                           FlowController flowController)
Get an Exception handler method.

Parameters:
methodName - the name of the method to get.
ex - the Exception that is to be handled.
Returns:
the Method with the given name that handles the given Exception, or null if none matches.