org.apache.struts.chain
Class AbstractExceptionHandler

java.lang.Object
  extended byorg.apache.struts.chain.AbstractExceptionHandler
All Implemented Interfaces:
org.apache.commons.chain.Command
Direct Known Subclasses:
ExceptionHandler

public abstract class AbstractExceptionHandler
extends java.lang.Object
implements org.apache.commons.chain.Command

Invoke the local or global exception handler configured for the exception class that occurred.

Version:
$Rev: 54933 $ $Date: 2004-10-16 18:04:52 +0100 (Sat, 16 Oct 2004) $
Author:
Craig R. McClanahan

Field Summary
private  java.lang.String actionConfigKey
           
private  java.lang.String exceptionKey
           
private  java.lang.String forwardConfigKey
           
private static org.apache.commons.logging.Log log
           
private  java.lang.String moduleConfigKey
           
 
Constructor Summary
AbstractExceptionHandler()
           
 
Method Summary
 boolean execute(org.apache.commons.chain.Context context)
          Invoke the appropriate Action for this request, and cache the returned ActionForward.
 java.lang.String getActionConfigKey()
          Return the context attribute key under which the ActionConfig for the currently selected application action is stored.
 java.lang.String getExceptionKey()
          Return the context attribute key under which any thrown exception will be stored.
 java.lang.String getForwardConfigKey()
          Return the context attribute key under which the ForwardConfig for the currently selected application action is stored.
 java.lang.String getModuleConfigKey()
          Return the context attribute key under which the ModuleConfig for the currently selected application action is stored.
protected abstract  org.apache.struts.config.ForwardConfig handle(org.apache.commons.chain.Context context, java.lang.Exception exception, org.apache.struts.config.ExceptionConfig exceptionConfig, org.apache.struts.config.ActionConfig actionConfig, org.apache.struts.config.ModuleConfig moduleConfig)
          Perform the required handling of the specified exception.
 void setActionConfigKey(java.lang.String actionConfigKey)
          Set the context attribute key under which the ActionConfig for the currently selected application action is stored.
 void setExceptionKey(java.lang.String exceptionKey)
          Set the context attribute key under which any thrown exception will be stored.
 void setForwardConfigKey(java.lang.String forwardConfigKey)
          Set the context attribute key under which the ForwardConfig for the currently selected application action is stored.
 void setModuleConfigKey(java.lang.String moduleConfigKey)
          Set the context attribute key under which the ModuleConfig for the currently selected application action is stored.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

actionConfigKey

private java.lang.String actionConfigKey

exceptionKey

private java.lang.String exceptionKey

forwardConfigKey

private java.lang.String forwardConfigKey

moduleConfigKey

private java.lang.String moduleConfigKey

log

private static final org.apache.commons.logging.Log log
Constructor Detail

AbstractExceptionHandler

public AbstractExceptionHandler()
Method Detail

getActionConfigKey

public java.lang.String getActionConfigKey()

Return the context attribute key under which the ActionConfig for the currently selected application action is stored.


setActionConfigKey

public void setActionConfigKey(java.lang.String actionConfigKey)

Set the context attribute key under which the ActionConfig for the currently selected application action is stored.

Parameters:
actionConfigKey - The new context attribute key

getExceptionKey

public java.lang.String getExceptionKey()

Return the context attribute key under which any thrown exception will be stored.


setExceptionKey

public void setExceptionKey(java.lang.String exceptionKey)

Set the context attribute key under which any thrown exception will be stored.

Parameters:
exceptionKey - The new context attribute key

getForwardConfigKey

public java.lang.String getForwardConfigKey()

Return the context attribute key under which the ForwardConfig for the currently selected application action is stored.


setForwardConfigKey

public void setForwardConfigKey(java.lang.String forwardConfigKey)

Set the context attribute key under which the ForwardConfig for the currently selected application action is stored.

Parameters:
forwardConfigKey - The new context attribute key

getModuleConfigKey

public java.lang.String getModuleConfigKey()

Return the context attribute key under which the ModuleConfig for the currently selected application action is stored.


setModuleConfigKey

public void setModuleConfigKey(java.lang.String moduleConfigKey)

Set the context attribute key under which the ModuleConfig for the currently selected application action is stored.

Parameters:
moduleConfigKey - The new context attribute key

execute

public boolean execute(org.apache.commons.chain.Context context)
                throws java.lang.Exception

Invoke the appropriate Action for this request, and cache the returned ActionForward.

Specified by:
execute in interface org.apache.commons.chain.Command
Parameters:
context - The Context for the current request
Returns:
false if a ForwardConfig is returned, else true to complete processing
Throws:
InvalidPathException - if no valid action can be identified for this request
java.lang.Exception

handle

protected abstract org.apache.struts.config.ForwardConfig handle(org.apache.commons.chain.Context context,
                                                                 java.lang.Exception exception,
                                                                 org.apache.struts.config.ExceptionConfig exceptionConfig,
                                                                 org.apache.struts.config.ActionConfig actionConfig,
                                                                 org.apache.struts.config.ModuleConfig moduleConfig)
                                                          throws java.lang.Exception

Perform the required handling of the specified exception.

Parameters:
context - The Context for this request
exception - The exception being handled
exceptionConfig - The corresponding ExceptionConfig
actionConfig - The ActionConfig for this request
moduleConfig - The ModuleConfig for this request
Returns:
the ForwardConfig to be processed next (if any), or null if processing has been completed
Throws:
java.lang.Exception


Copyright ? 2003 - Apache Software Foundation