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))"
相关推荐
BingoGo17 小时前
“Fatal error: require(): Failed opening required...” 以及如何彻底避免它再次出现
后端·php
咩图17 小时前
VSCode+Python创建项目
开发语言·python
zhanglu511617 小时前
Java Lambda 表达式使用深度解析
开发语言·前端·python
zhougl99617 小时前
Springboot - druid 连接池
java·spring boot·后端
Hello.Reader17 小时前
Flink Python REPL(pyflink-shell)实战:本地/远程/YARN 三种启动方式 + Table API 交互开发流程
python·flink·交互
henry10101017 小时前
利用Python一键创建AWS EC2实例
linux·python·云计算·aws·ec2
EveryPossible18 小时前
工作流练习
服务器·python·缓存
JaguarJack18 小时前
“Fatal error: require(): Failed opening required...” 以及如何彻底避免它再次出现
后端·php·服务端
一次旅行18 小时前
接口自动化测试模板
数据库·python·pytest
MX_935918 小时前
Spring基本配置和注入配置注解使用
java·后端·spring