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))"
相关推荐
前端 贾公子29 分钟前
LangGraph == 图的状态(State)管理 (中)
开发语言·数据库·python
霸道流氓气质1 小时前
LLM API密钥管理与轮换策略:Spring Vault动态密钥、熔断限流协同与多Provider路由的 Java 生产级实现
java·后端·spring
凤山老林1 小时前
Spring Boot 集成 Redis Stream 做可靠消息队列:持久化、消费组重组与流式处理实战
spring boot·redis·后端
codigger1 小时前
哈希算法:一根看不见的 "指纹",如何撑起整个互联网
后端·区块链·哈希算法·sha256
the局外人1 小时前
FastAPI中jwt的基本使用与实践
后端·python·fastapi
mklpo1471 小时前
为不支持sse4.2命令集的老旧设备制作Win11 26H2系统镜像,2026-10-11。
运维·windows·python
GoldenSpider.AI1 小时前
用 AI 改流程之前先做「四桶」体检:9 次返工里 8 次靠规则就能消掉(附 Python 发布前校验器)
人工智能·python·自动化·ai智能体
FullStackGeek1 小时前
微信缴费APIV3接入
后端
小白快快跑哦1 小时前
python-字符串全解(六):正则表达式-修饰符
python·正则表达式·修饰符
灯澜忆梦1 小时前
【Go Zap 日志库】#1 |快速上手 + 配置详解
开发语言·后端·golang