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))"
相关推荐
闻哥3 小时前
Redis事务详解
java·数据库·spring boot·redis·缓存·面试
hrhcode3 小时前
【Netty】五.ByteBuf内存管理深度剖析
java·后端·spring·springboot·netty
CeshirenTester4 小时前
9B 上端侧:多模态实时对话,难点其实在“流”
开发语言·人工智能·python·prompt·测试用例
Starry_hello world4 小时前
Python (2)
python
ID_180079054734 小时前
Python爬取京东商品库存数据与价格监控
jvm·python·oracle
NEXT064 小时前
后端跑路了怎么办?前端工程师用 Mock.js 自救实录
前端·后端·程序员
泯泷4 小时前
提示工程的悖论:为什么与 AI 对话比你想象的更难
人工智能·后端·openai
-To be number.wan5 小时前
Python数据分析:时间序列数据分析
开发语言·python·数据分析
Faker66363aaa5 小时前
YOLO13-C3K2-AdditiveBlock:水果质量智能检测系统_3
python
马士兵教育6 小时前
程序员简历如何编写才能凸显出差异化,才能拿到更多面试机会?
开发语言·后端·面试·职场和发展·架构