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))"
相关推荐
吴佳浩1 小时前
Python入门指南(五) - 为什么选择 FastAPI?
后端·python·fastapi
寰天柚子2 小时前
Java并发编程中的线程安全问题与解决方案全解析
java·开发语言·python
memgLIFE2 小时前
Springboot 分层结构
java·spring boot·spring
GoGeekBaird2 小时前
分享几个使用Nano Banana Pro 画信息图的提示词
后端·github
shoubepatien2 小时前
JAVA -- 08
java·后端·intellij-idea
2503_928411562 小时前
项目中的一些问题(补充)
人工智能·python·tensorflow
yangminlei2 小时前
springboot pom.xml配置文件详细解析
java·spring boot·后端
superman超哥2 小时前
仓颉语言中锁的实现机制深度剖析与并发实践
c语言·开发语言·c++·python·仓颉
黄俊懿2 小时前
【深入理解SpringCloud微服务】Seata(AT模式)源码解析——全局事务的提交
java·后端·spring·spring cloud·微服务·架构·架构师
vv_Ⅸ2 小时前
打卡day42
python