SpringBoot AOP切入点表达式

介绍

在AOP中可以通过注解来定义 切入点表达式来控制被监控的方法。

匹配所有 com.example.service 包下以 Service 结尾的方法:

java 复制代码
"execution(* com.example.service.*Service.*(..))"

匹配任意类的 public 方法:

java 复制代码
"execution(public * *(..))"

匹配 com.example.service 包及其子包下的任意方法:

java 复制代码
"execution(* com.example.service..*.*(..))"

匹配 MyService 类中的 doSomething 方法:

java 复制代码
"execution(* com.example.service.MyService.doSomething(..))"

匹配 com.example.service 包中的任何类的 save 方法,且方法参数为 java.lang.String 类型

yaml 复制代码
"execution(* com.example.service.*.save(java.lang.String))"
相关推荐
量化分析码农13 小时前
【Python量化多因子实战 05】因子也会轮动:因子动量与因子反转的择时应用
后端
陈随易13 小时前
Rolldown 把插件改动回传提速 26 倍
前端·后端·程序员
金銀銅鐵1 天前
为什么枚举类中可以定义抽象方法
java·后端·ai编程
陈随易1 天前
Vue 编译器换掉 source map,快了三四成
前端·后端·程序员
❁满城风絮*1 天前
Claude Code 学习总结
python·agent·claude
txxzjmzlh1 天前
SpringBoot 统⼀功能处理
java·spring boot·后端
nice_lcj5201 天前
Java Lambda 表达式入门:怎么写、怎么用、常用方法有哪些
java·开发语言·后端·面试
维克兜率天1 天前
【维克】复合型CTA:趋势+套利的双轮驱动
python·学习方法
伞伞悦读1 天前
【第76期】两张3行表左连接变5行:主键、validate与未匹配排查完整教程
人工智能·python
IT_陈寒1 天前
Redis大key删除为什么会导致服务卡顿?我的线上事故复盘
前端·人工智能·后端