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))"
相关推荐
爱睡懒觉的焦糖玛奇朵2 小时前
【从视频到数据集:焦糖玛奇朵的魔法工具使用说明】
人工智能·python·深度学习·学习·算法·yolo·音视频
Warson_L2 小时前
python - set/tuple/dict quiz
后端
IT_Octopus2 小时前
Spring Boot 实战:@PostConstruct + Caffeine 缓存初始化与定时刷新
spring boot·后端·缓存
swipe3 小时前
从本地开发到生产部署:用 Docker Compose 跑通 NestJS、MySQL 与 Milvus
后端·langchain·llm
yangshicong3 小时前
第11章:结构化输出与数据提取 —— 让 AI 直接返回你想要的数据格式
数据库·人工智能·redis·python·langchain·ai编程
码事漫谈3 小时前
SenseNova Skills Studio:为商汤SenseNova U1打造的本地办公技能包
后端
言之。3 小时前
【Python】免费的中文 AI 配音方案
开发语言·人工智能·python
zhangxingchao3 小时前
AI应用开发七:可以替代 RAG 的技术
前端·人工智能·后端
Warson_L3 小时前
python dict key详解
python
天天进步20153 小时前
Python全栈项目:从零手操一个高性能 API 网关
开发语言·python