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))"
相关推荐
用户9562562542912 小时前
五分钟用 E2B SDK 打通沙箱:环境变量只改三行
python·api
一条Go12 小时前
OnCall 时段路由:跨午夜、左闭右开与「Local 不是时区」
后端·架构·github
Moment13 小时前
不会后期的我,发现了一个开源胶片神器😍😍😍
前端·后端·开源
数据库小学妹13 小时前
pgbouncer 事务池:prepared statement、临时表与会话状态
数据库·后端·postgresql
用户951794225102913 小时前
最小循环:让 Agent 跑起来(I1)
python·agent
沉默小管13 小时前
上班鼓励器_桌宠版
python
SomeOtherTime13 小时前
Rust 面向对象介绍(AI回答)
开发语言·python·rust
duansamve13 小时前
Flask中视图函数接收请求数据和返回响应实例
python·flask
三小河13 小时前
SWC 凭什么比 Babel 快 ?项目优化迁移踩坑记录
前端·后端
鶴哥只手遮天14 小时前
《Redis 8.10.3 深度剖析》系列 ·第 17 章. 一个迟到十六年的类型
redis·后端·开源