ReflectiveMethodInvocation.proceed()
调用过程:
ReflectiveMethodInvocation 中的((MethodInterceptor) interceptorOrInterceptionAdvice).invoke(this)
会有一个拦截器去一调用,this关键字会回调
//都会回调ReflectiveMethodInvocation.proceed()
1 ExposeInvocationInterceptor–>invoke()
2 TransactionInterceptor–>invoke()–>invokeWithinTransaction(callBack)
3ReflectiveMethodInvocation.invokeJoinpoint()
4 AopUtils.invokeJoinpointUsingReflection()
首先需要运行在实物上下文环境,service的调用都是动态代理,例子中的是jdk动态代理,然后进过一系列的拦截器, 调用proceed() 最后调用
invokeJoinpoint() 最后执行目标类的方法
调用关系:
Daemon Thread [http-bio-8080-exec-2] (Suspended)
TransactionInterceptor 1.proceedWithInvocation()line:96TransactionInterceptor(TransactionAspectSupport).invokeWithinTr