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))"
相关推荐
李航198310 分钟前
AI定制柜建模,需要详细的建模规范和标准流程
人工智能·python·计算机视觉·ai·ai编程
沙漠之主34 分钟前
Python 教学设计资料:从入门到实战的完整课程方案
爬虫·python
code_slave(码畜)1 小时前
微服务架构落地:基础服务 —— 报表服务(中篇:元数据、查询引擎、缓存与权限落地)
spring boot·spring cloud·缓存·微服务·架构
ZealSinger1 小时前
Boot4挂起函数丢traceId怎么修
spring boot·kotlin·协程·可观测性
IT_陈寒2 小时前
SpringBoot自动配置坑了我一把,原来是这样绕过去的
前端·人工智能·后端
ebiobiz2 小时前
极海 APM32 使用 Nimmake 编译指南
c++·python·单片机·嵌入式硬件·mcu
code_slave(码畜)2 小时前
微服务架构落地:基础服务 —— 报表服务(AI 集成篇:AI 增强报表能力)
人工智能·spring boot·spring cloud·微服务·架构
要努力啊4692 小时前
用 Codex 加速 Java 开发:从代码生成到测试覆盖的完整实战
后端
dora2 小时前
LangChain4j 新手入门实战教程(Java版)
后端·langchain·agent
蜗牛互联网2 小时前
MongoDB Atlas Agent Engine之后,如何用版本门禁防止陈旧写入
java·数据库·人工智能·后端·mongodb