类 ThrowsAdviceInterceptor
java.lang.Object
infra.aop.framework.adapter.ThrowsAdviceInterceptor
- 所有已实现的接口:
AfterAdvice,Advice,Interceptor,MethodInterceptor
Interceptor to wrap an after-throwing advice.
The signatures on handler methods on the ThrowsAdvice
implementation method argument must be of the form:
void afterThrowing([Method, args, target], ThrowableSubclass);
Only the last argument is required.
Some examples of valid methods would be:
public void afterThrowing(Exception ex)
public void afterThrowing(RemoteException)
public void afterThrowing(Method method, Object[] args, Object target, Exception ex)
This is a framework class that need not be used directly by Framework users.
- 从以下版本开始:
- 4.0
- 作者:
- Rod Johnson, Juergen Hoeller, Harry Yang
- 另请参阅:
-
字段概要
字段 -
构造器概要
构造器构造器说明ThrowsAdviceInterceptor(Object throwsAdvice) Create a new ThrowsAdviceInterceptor for the given ThrowsAdvice. -
方法概要
修饰符和类型方法说明private MethodgetExceptionHandler(Throwable exception) Determine the exception handle method for the given exception.intReturn the number of handler methods in this advice.Implement this method to perform extra treatments before and after the invocation.private voidinvokeHandlerMethod(MethodInvocation mi, Throwable ex, Method method)
-
字段详细资料
-
AFTER_THROWING
- 另请参阅:
-
logger
private static final infra.logging.Logger logger -
throwsAdvice
-
exceptionHandlerMap
Methods on throws advice, keyed by exception class.
-
-
构造器详细资料
-
ThrowsAdviceInterceptor
Create a new ThrowsAdviceInterceptor for the given ThrowsAdvice.- 参数:
throwsAdvice- the advice object that defines the exception handler methods (usually aThrowsAdviceimplementation)
-
-
方法详细资料
-
getHandlerMethodCount
public int getHandlerMethodCount()Return the number of handler methods in this advice. -
invoke
从接口复制的说明:MethodInterceptorImplement this method to perform extra treatments before and after the invocation. Polite implementations would certainly like to invokeJoinpoint.proceed().- 指定者:
invoke在接口中MethodInterceptor- 参数:
mi- the method invocation joinpoint- 返回:
- the result of the call to
Joinpoint.proceed(), might be intercepted by the interceptor. - 抛出:
Throwable- if the interceptors or the target-object throws an exception.
-
getExceptionHandler
Determine the exception handle method for the given exception.- 参数:
exception- the exception thrown- 返回:
- a handler for the given exception type, or
nullif none found
-
invokeHandlerMethod
- 抛出:
Throwable
-