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))"
相关推荐
卓怡学长9 小时前
w255基于springboot仓库管理系统
java·数据库·spring boot·spring·intellij-idea
谭光志10 小时前
Vibe Coding 时代,程序员该何去何从
前端·后端·ai编程
GoGeekBaird11 小时前
我用 BeeWeave 跑完了一次完整写作闭环
后端·github
闻道且行之11 小时前
TurboOCR:基于PP-OCRv6的极速Windows离线OCR工具,深度解析3.4GB依赖背后的技术架构
c++·人工智能·python·qt·机器学习·ocr
仿生狮子12 小时前
别再说“全栈”了,AI 时代团队只认这 5 种人
前端·人工智能·后端
许彰午12 小时前
95_Python内存管理与垃圾回收
开发语言·python
csdn2015_12 小时前
springboot读取配置的方法
java·spring boot·spring
骄阳如火13 小时前
Python 性能深度剖析:从“被诟病的慢”到“Rust 重塑”的拐点
python
满怀冰雪13 小时前
03-第一个 Paddle 程序:Tensor 创建、计算与设备管理
人工智能·python·paddle
CClaris13 小时前
大模型量化从0到1(九):用 llama.cpp 把模型转成 GGUF 并跑本地推理
人工智能·pytorch·python·深度学习·llama