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))"
相关推荐
Victor3561 小时前
MySQL(185)如何进行MySQL的容量规划?
后端
Victor3561 小时前
MySQL(186)如何理解MySQL的调优原则?
后端
尚学教辅学习资料4 小时前
SpringBoot3.x入门到精通系列:4.3 性能优化技巧
spring boot·性能优化
右手嘚温暖5 小时前
分布式事务Seata、LCN的原理深度剖析
spring boot·分布式·后端·spring·spring cloud·中间件·架构
麦兜*7 小时前
Spring Boot集成方案 + Elasticsearch向量检索,语义搜索核弹
java·spring boot·python·spring·elasticsearch·spring cloud·系统架构
仪器科学与传感技术博士7 小时前
python:讲懂决策树,为理解随机森林算法做准备,以示例带学习,通俗易懂,容易理解和掌握
python·算法·决策树
歪歪1007 小时前
HTML 如何转 Markdown
开发语言·chrome·python·程序人生·html
Absinthe_苦艾酒8 小时前
JVM学习专题(四)对象创建过程
java·jvm·后端
王者鳜錸8 小时前
PYTHON从入门到实践-18Django模版渲染
开发语言·python·django
hweiyu009 小时前
IDEA搭建GO环境
开发语言·后端·golang·intellij-idea·idea·intellij idea