public class ExceptionCatcher extends ActionCommandBase implements org.apache.commons.chain.Filter
Intercept any exception thrown by a subsequent Command in
this processing chain, and fire the configured exception handler chain
after storing the exception that has occurred into the
Context.
| Constructor and Description |
|---|
ExceptionCatcher() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
execute(ActionContext actionCtx)
Clear any existing stored exception and pass the
context on to the remainder of the current chain. |
java.lang.String |
getCatalogName()
Return the name of the
Catalog in which to perform
lookups, or null for the default Catalog. |
java.lang.String |
getExceptionCommand()
Return the name of the command to be executed if an exception
occurs.
|
protected org.apache.commons.chain.Command |
lookupExceptionCommand()
Return the command to be executed if an exception occurs.
|
boolean |
postprocess(org.apache.commons.chain.Context context,
java.lang.Exception exception)
If an exception was thrown by a subsequent
Command,
pass it on to the specified exception handling chain. |
void |
setCatalogName(java.lang.String catalogName)
Set the name of the
Catalog in which to perform
lookups, or null for the default Catalog. |
void |
setExceptionCommand(java.lang.String exceptionCommand)
Set the name of the command to be executed if an exception
occurs.
|
executepublic java.lang.String getCatalogName()
Return the name of the Catalog in which to perform
lookups, or null for the default Catalog.
public void setCatalogName(java.lang.String catalogName)
Set the name of the Catalog in which to perform
lookups, or null for the default Catalog.
catalogName - The new catalog name or nullpublic java.lang.String getExceptionCommand()
Return the name of the command to be executed if an exception occurs.
public void setExceptionCommand(java.lang.String exceptionCommand)
Set the name of the command to be executed if an exception occurs.
exceptionCommand - The name of the chain to be executedpublic boolean execute(ActionContext actionCtx) throws java.lang.Exception
Clear any existing stored exception and pass the
context on to the remainder of the current chain.
execute in interface ActionCommandexecute in class ActionCommandBaseactionCtx - The Context for the current requestfalse so that processing continuesjava.lang.Exception - On any errorpublic boolean postprocess(org.apache.commons.chain.Context context,
java.lang.Exception exception)
If an exception was thrown by a subsequent Command,
pass it on to the specified exception handling chain. Otherwise, do
nothing.
postprocess in interface org.apache.commons.chain.Filtercontext - The Context to be processed by this Filterexception - The Exception (if any) that was thrown by
the last Command that was executed; otherwise
nulljava.lang.IllegalStateException - If exception throws exceptionprotected org.apache.commons.chain.Command lookupExceptionCommand()
Return the command to be executed if an exception occurs.
java.lang.IllegalArgumentException - If catalog cannot be foundjava.lang.IllegalStateException - If command property is not specifiedCopyright © 2000–2024 Apache Software Foundation. All rights reserved.