CglibAopProxy类第688行:new CglibMethodInvocation(proxy, target, method, args, targetClass, chain, methodProxy).proceed();
参数 chain:拦截器链,保含了目标方法的所有切面方法 ,从chain里面的数组元素的顺序来看,拦截器的顺序before不再after前面执行
每一个 **Interceptor有一个invoke()方法
Interceptor是一个空接口 MethodInterceptor extends Interceptor ,以下是Interceptor的继承结构:
public interface Advice { } public interface Interceptor extends Advice { } public interface MethodInterceptor extends Interceptor { Object invoke(MethodInvocation invocation) throws Throwable; }
Object invoke(MethodInvocation invocation) throws Throwable;方法:
参数 :MethodInvocation 类中有proceed()方法,以下是MethodInvocation的继承结构:
public interface Joinpoint { Object proceed() throws Throwable; Object getThis(); AccessibleObject getStaticPart(); } public interface Invocation extends Joinpoint { Object[] getArguments(); } public interface MethodInvocation extends Invocation { Method getMethod(); }