spring在进行aop增强的时候,会根据当前被代理类是否有实现接口来决定使用jdk代理方式,还是cglib方式;
这个地方因为SnailRetryEndPoint实现了Lifecycle接口,spring会使用jdk代理方式进行aop增强,那么SnailEndPointScanner.scanEndPoint方法中直接拿代理对象类去获取注解时候,是拿不到注解信息的,并且下面通过代理对象类获取
Map<Method,Mapping> annotatedMethods;
也一样是拿不到对应信息的;
我调试过程中,尝试使用TargetClass就没有问题:
Class executorNotProxy = AopProxyUtils.ultimateTargetClass(bean);