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))"
相关推荐
ltl3 小时前
Transformer 整体架构:一张图看懂
后端
ltl3 小时前
Decoder 详解:为什么它天生适合生成
后端
Li emily3 小时前
解决了加密货币api多币种订阅时的数据乱序问题
人工智能·python·api·fastapi
ltl4 小时前
Encoder 详解:6 层堆叠到底在做什么
后端
程序员cxuan4 小时前
微信读书官方发了 skills,把我给秀麻了。
人工智能·后端·程序员
2301_781571424 小时前
Golang格式化输出占位符都有什么_Golang fmt占位符教程【通俗】
jvm·数据库·python
asdzx674 小时前
使用 Python 为 PDF 添加页码 (详细教程)
python·pdf·页码
AI技术控4 小时前
《Transformers are Inherently Succinct》论文解读:从“能表达什么”到“多紧凑地表达”
人工智能·python·深度学习·机器学习·自然语言处理
未若君雅裁4 小时前
Spring AOP、日志切面与声明式事务原理
java·后端·spring
zhangxingchao5 小时前
AI应用开发六:企业知识库
前端·人工智能·后端