|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectch.elca.el4j.services.exceptionhandler.AbstractExceptionHandlerInterceptor
public abstract class AbstractExceptionHandlerInterceptor
This class provides functionality to handle exceptions centrally (with respect to a number of classes or the whole system).
| Field Summary | |
|---|---|
protected static ThreadLocal |
s_retries
Holds the number of retries. |
| Constructor Summary | |
|---|---|
AbstractExceptionHandlerInterceptor()
|
|
| Method Summary | |
|---|---|
protected Object |
doHandleException(Throwable t,
org.aopalliance.intercept.MethodInvocation invocation,
ExceptionConfiguration[] exceptionConfigurations)
Handles the given exception that was thrown given method invocation using the provided exception configurations. |
protected Object |
doInvoke(org.aopalliance.intercept.MethodInvocation invocation)
Performs the actual invocation of the MethodInvocation.prceed() method. |
static int |
getRetries()
|
protected abstract Object |
handleException(Throwable t,
org.aopalliance.intercept.MethodInvocation invocation)
Handles the given exception that was thrown in the given method invocation's execution. |
protected void |
handleInterfaceExceptions(org.aopalliance.intercept.MethodInvocation invocation,
Throwable t)
Handles exceptions that are listed in a method's signature. |
Object |
invoke(org.aopalliance.intercept.MethodInvocation invocation)
|
void |
setDefaultBehaviourConsume(boolean defaultBehaviourConsume)
Sets the interceptor's exception handling default policy. |
void |
setForwardSignatureExceptions(boolean forwardSignatureException)
Sets whether all exceptions have to be handled by this safety facade, even those which are listed in the signature. |
void |
setHandleRTSignatureExceptions(boolean handleRTSignatureExceptions)
Sets whether runtime exceptions, that are listed in a method's signature, have to be handled. |
protected static void |
setRetries(int retries)
Sets the number of retries. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final ThreadLocal s_retries
| Constructor Detail |
|---|
public AbstractExceptionHandlerInterceptor()
| Method Detail |
|---|
public static int getRetries()
AbstractRetryExceptionHandlers
to determine whether they have to call their handling routines.
-1 signals that no retires have been registered so far.protected static void setRetries(int retries)
retries - The number of retries to set.public void setHandleRTSignatureExceptions(boolean handleRTSignatureExceptions)
handleRTSignatureExceptions - true to handle unchecked exceptions by this exception
handler, false to rethorw them.public void setDefaultBehaviourConsume(boolean defaultBehaviourConsume)
defaultBehaviourConsume - true to consume all exceptions that are not handled by
an exception handler, false to forward all unhandled
exceptions.public void setForwardSignatureExceptions(boolean forwardSignatureException)
forwardSignatureException - true forces to forward any exceptions listed in a
method's interface (even unchecked exceptions, if they are in the
signature). false handles all exceptions by an
appropriate registered exception handler.setHandleRTSignatureExceptions(boolean)
public Object invoke(org.aopalliance.intercept.MethodInvocation invocation)
throws Throwable
invoke in interface org.aopalliance.intercept.MethodInterceptorThrowable
protected Object doInvoke(org.aopalliance.intercept.MethodInvocation invocation)
throws RetryException,
Throwable
MethodInvocation.prceed() method.
invocation - The MethodInvocation to call proceed() on.
RetryException - Signals that the complete invocation has to be rerun.
Throwable - Any exception thrown by the original method's invocation or by
one of the used exception handlers.
protected abstract Object handleException(Throwable t,
org.aopalliance.intercept.MethodInvocation invocation)
throws RetryException,
Throwable
t - The exception to handle.invocation - The method invocation that threw the exception.
RetryException - Signals that the complete invocation has to be rerun.
Throwable - Any exception thrown by a exception handler.
protected void handleInterfaceExceptions(org.aopalliance.intercept.MethodInvocation invocation,
Throwable t)
throws Throwable
invocation - The called method invocation.t - The caught exception.
Throwable - The given exception t if it has to be forwarded to the
invoker.
protected Object doHandleException(Throwable t,
org.aopalliance.intercept.MethodInvocation invocation,
ExceptionConfiguration[] exceptionConfigurations)
throws RetryException,
Throwable
t - The exception to handle.invocation - The method invocation that threw the exception.exceptionConfigurations - The exception handler configuration to use.
RetryException - Signals that the complete invocation has to be rerun.
Throwable - Any exception thrown by a exception handler.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||