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))"
相关推荐
暗黑小白1 分钟前
参数从哪来、何时来 —— 提取时机与平台化 Slot 管理
人工智能·后端·大模型·ai agent
小白勇闯网安圈18 分钟前
Django Ajax、批量操作与分页实践
python·django
Logintern0932 分钟前
Langgraph使用MemorySaver建立有记忆的图
开发语言·windows·python
程序员鱼皮1 小时前
DeepSeek Harness 最新邪修曝光!被吹成核弹的极简模式,真的夯吗?
前端·后端·ai编程
Gopher_HBo1 小时前
请求绑定与校验
后端
Uncommon.1 小时前
使用pandas处理csv并转为张量
pytorch·python·深度学习·pandas
长栎1 小时前
你写的撤销功能,99% 是伪 Memento——Undo 不是存个备份那么简单
后端
笨鸟飞不快1 小时前
RocketMQ Lite Topic 流程梳理与设计解读
后端·rocketmq
步行cgn1 小时前
MyBatis 查询结果字段为 null?一文讲透下划线命名与驼峰映射问题
后端
技术长镜头1 小时前
别再只会“加索引”:从磁盘页到 B+Tree,彻底理解 MySQL 索引的设计与运行
后端·mysql