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();

}
View Code

相关文章:

  • 2022-12-23
  • 2021-05-19
  • 2021-08-28
  • 2022-02-01
  • 2022-12-23
  • 2022-12-23
  • 2021-10-20
猜你喜欢
  • 2021-06-21
  • 2021-11-29
  • 2022-12-23
  • 2021-09-15
  • 2021-09-04
  • 2021-08-30
相关资源
相似解决方案