|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.struts.chain.commands.ActionCommandBase org.apache.struts.chain.commands.ExceptionCatcher
public class ExceptionCatcher
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
.
Field Summary |
---|
Fields inherited from interface org.apache.commons.chain.Command |
---|
CONTINUE_PROCESSING, PROCESSING_COMPLETE |
Constructor Summary | |
---|---|
ExceptionCatcher()
|
Method Summary | |
---|---|
boolean |
execute(ActionContext actionCtx)
Clear any existing stored exception and pass the context on to the remainder of the current chain. |
String |
getCatalogName()
Return the name of the Catalog in which to perform
lookups, or null for the default Catalog . |
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,
Exception exception)
If an exception was thrown by a subsequent Command ,
pass it on to the specified exception handling chain. |
void |
setCatalogName(String catalogName)
Set the name of the Catalog in which to perform
lookups, or null for the default Catalog . |
void |
setExceptionCommand(String exceptionCommand)
Set the name of the command to be executed if an exception occurs. |
Methods inherited from class org.apache.struts.chain.commands.ActionCommandBase |
---|
execute |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.commons.chain.Command |
---|
execute |
Constructor Detail |
---|
public ExceptionCatcher()
Method Detail |
---|
public String getCatalogName()
Return the name of the Catalog
in which to perform
lookups, or null
for the default Catalog
.
public void setCatalogName(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 null
public String getExceptionCommand()
Return the name of the command to be executed if an exception occurs.
public void setExceptionCommand(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 Exception
Clear any existing stored exception and pass the
context
on to the remainder of the current chain.
execute
in interface ActionCommand
execute
in class ActionCommandBase
actionCtx
- The Context
for the current request
false
so that processing continues
Exception
- On any errorpublic boolean postprocess(org.apache.commons.chain.Context context, 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.Filter
context
- The Context
to be processed by this Filter
exception
- The Exception
(if any) that was thrown by
the last Command
that was executed; otherwise
null
IllegalStateException
- If exception throws exceptionprotected org.apache.commons.chain.Command lookupExceptionCommand()
Return the command to be executed if an exception occurs.
IllegalArgumentException
- If catalog cannot be found
IllegalStateException
- If command property is not specified
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |