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))"
相关推荐
2601_9687931412 分钟前
Python Requests 轻量自动化:无需浏览器,实现真人级账号浏览模拟
开发语言·python·自动化
IT_陈寒23 分钟前
Java开发实战:从入门到精通
前端·人工智能·后端
jktantan36 分钟前
注解式脱敏:用 Jackson 的 ContextualSerializer 做字段级策略(一)
spring boot·后端·算法·spring cloud·系统架构
段一凡-华北理工大学9 小时前
工业智能体:从Codex/Claude到项目实战~系列文章05:从“AI助手“到“工业智能体“:能力跃迁与落地范式
人工智能·python·claude·codex·工业智能体·高炉炼铁智能化
独泪了无痕9 小时前
探索Pinyin4j-Java中的拼音转换利器
java·后端
码事漫谈10 小时前
从 Coze 居然要下线了说起
后端
深蓝AI10 小时前
ContextVar 到线程池就丢了?asyncio.to_thread 和 run_in_executor 实测
python
想不到一个好的ID11 小时前
智能体开发
后端
皮皮林55111 小时前
为什么数据库连接池不采用 IO 多路复用?
后端
岁月宁静11 小时前
什么是 Agent:从"会聊天"到"会做事"
人工智能·python