为什么使用aspectj @within进行注解的aop时候,标注对应注解的类仅仅只有pointcut within使用的注解,其他的标注在类上的注解都不见了,求大神指定@Component
@DisableThrottlingPolicy
@EnableThrottlingPolicy
public class EnableThrottingPolicyAnnotationTest { @ThrottlingGroupRule(groupRuleName = "groupruleName", rules = {})
public void test() {
System.out.println("=============test===============");
}
}@Documented
@Retention(RUNTIME)
@Target({ TYPE, METHOD })
public @interface DisableThrottlingPolicy {
}@Documented
@Retention(RUNTIME)
@Target({ TYPE, METHOD })
public @interface EnableThrottlingPolicy {
}@Aspect
@Component
public class ThrottlePolicyAnnotationAdvice { @Autowired
private ThrottlingParserFactory throttlingParserFactory; @Pointcut("@within(com.ctim.framework.throttle.annotation.EnableThrottlingPolicy)")
public void aspectjMethod() {
}
       
       @Around(value = "aspectjMethod()")
public Object aroundAdvice(ProceedingJoinPoint pjp) throws Throwable { // 为什么这里面获得的EnableThrottingPolicyAnnotationTest 的注解只有EnableThrottlingPolicy,DisableThrottlingPolicy和compone注解都不见了,求大神指定
Annotation[] annotations = pjp.getThis().getClass().getAnnotations();
System.out.println(annotations);
         }
}