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))"
相关推荐
ん贤39 分钟前
Go channel 深入解析
开发语言·后端·golang
小陳参上3 小时前
用Python创建一个Discord聊天机器人
jvm·数据库·python
changhong19864 小时前
如何在 Spring Boot 中配置数据库?
数据库·spring boot·后端
minstbe5 小时前
IC设计私有化AI助手实战:基于Docker+OpenCode+Ollama的数字前端综合增强方案(进阶版)
人工智能·python·语言模型·llama
zyq99101_16 小时前
优化二分查找:前缀和降复杂度
数据结构·python·蓝桥杯
qyzm6 小时前
天梯赛练习(3月13日)
开发语言·数据结构·python·算法·贪心算法
月月玩代码6 小时前
Actuator,Spring Boot应用监控与管理端点!
java·spring boot·后端
XPoet7 小时前
AI 编程工程化:Skill——给你的 AI 员工装上技能包
前端·后端·ai编程
Java程序之猿7 小时前
SpringBoot + camel+IBM MQ实现消息队列处理
java·spring boot·mybatis
码事漫谈7 小时前
从“功能实现”到“深度优化”:金仓数据库连接条件下推技术的演进之路
后端