1、基本概念:
Aspect:切面
Join point:连接点
Advice:通知
Before advice:在连接点之前
After returning advice:连接点正常完成后
After throwing advice:方法抛出异常
After (finally) advice:无论何种方式退出,都会执行
Around advice:环绕连接点
Pointcut:切入点
Introduction:
Target object:
AOP proxy: JDK动态代理或CGLIB代理
Weaving:
2、 @AspectJ
依赖于aspectjweaver.jar
启用@AspectJ:@EnableAspectJAutoProxy或者直接标注@Component让其自动扫描
3、@Pointcut
切点表达式
execution
within
this
args
@target、@args、@args、@annotation
4、@Before、@AfterReturning、@AfterThrowing、@After、@Around
需要配置切入点
5、AspectJProxyFactory 、AnnotationBeanConfigurerAspect 、@EnableSpringConfigured
RequestContextHolder