@annotation(包名.注解名) 按注解进行拦截.
- 自定义注解参照自定义注解
环绕通知
package com.jt.aop;
import org.aspectj.lang.annotation.*;
import org.springframework.stereotype.Component;
@Component
@Aspect
public class CacheAop {
@Pointcut("@annotation(com.jt.anno.CacheFind)")
public void point(){
}
@Around("point()")
public Object around( ){
System.out.println("环绕通知");
return null;
}
}
@annotation(com.jt.anno.CacheFind)
com.jt.anno.CacheFind: 注解类所在的全路径