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 分钟前
基于SpringBoot的药房管理系统【个性化推荐+数据可视化】
java·spring boot·后端·mysql·spring·信息可视化·java-ee
codeGoogle9 分钟前
2026 年 IM 怎么选?聊聊 4 家主流即时通讯方案的差异
android·前端·后端
好家伙VCC9 分钟前
**发散创新:用 Rust构建多智能体系统,让分布式协作更高效**在人工智能快速演进的今天,**多智能体系统(
java·人工智能·分布式·python·rust
梦幻精灵_cq9 分钟前
*终端渲染天花板:文心道法解码——闲聊终端渲染状态一统江山
python
yuanmenghao10 分钟前
Linux 性能实战 | 第 18 篇:ltrace 与库函数性能分析
linux·python·性能优化
ValhallaCoder11 分钟前
hot100-图论
数据结构·python·算法·图论
小沈同学呀11 分钟前
Spring Boot实现加密字段模糊查询的最佳实践
java·spring boot·后端·encrypt
Maguyusi12 分钟前
go 批量生成 c++与lua的proto文件
开发语言·后端·golang·protobuf
破烂pan18 分钟前
Python 实现 HTTP Client 的常见方式
开发语言·python·http
J_liaty18 分钟前
SpringBoot缓存预热:ApplicationRunner与CommandLineRunner深度对比与实战
spring boot·后端·缓存