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))"
相关推荐
韩师学子--小倪12 分钟前
SpringBoot 优雅停服
spring boot·tomcat
逄逄不是胖胖34 分钟前
《动手学深度学习》-60translate实现
人工智能·python·深度学习
橘颂TA34 分钟前
【测试】自动化测试函数介绍——web 测试
python·功能测试·selenium·测试工具·dubbo
爱学习的阿磊38 分钟前
Python上下文管理器(with语句)的原理与实践
jvm·数据库·python
m0_7369191042 分钟前
Python面向对象编程(OOP)终极指南
jvm·数据库·python
one____dream1 小时前
【网安】Reverse-非常规题目
linux·python·安全·网络安全·ctf
冷雨夜中漫步1 小时前
python反转列表reverse()和[::-1]哪个效率更高
开发语言·python
rainbow68891 小时前
Python面向对象编程与异常处理实战
开发语言·python
weixin199701080161 小时前
锦程物流item_get - 获取详情接口对接全攻略:从入门到精通
数据库·python
李梨同学丶1 小时前
0201好虫子周刊
后端