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))"
相关推荐
q***925110 分钟前
Spring Cloud Data Flow 简介
后端·spring·spring cloud
m0_6398171527 分钟前
基于springboot火锅店管理系统【带源码和文档】
java·spring boot·后端
Petrichor_H_33 分钟前
DAY 31 文件的规范拆分和写法
python
咚咚王者1 小时前
人工智能之编程进阶 Python高级:第九章 爬虫类模块
开发语言·python
会编程的林俊杰1 小时前
SpringBoot项目启动时的依赖处理
java·spring boot·后端
码事漫谈1 小时前
C++循环结构探微:深入理解while与do...while
后端
李慕婉学姐1 小时前
【开题答辩过程】以《Javaweb的火花流浪动物救助系统设计与实现》为例,不会开题答辩的可以进来看看
vue.js·spring boot·mysql
q***72871 小时前
SpringBoot中整合RabbitMQ(测试+部署上线 最完整)
spring boot·rabbitmq·java-rabbitmq
深蓝海拓2 小时前
使matplot显示支持中文和负号
开发语言·python
码事漫谈2 小时前
现代C++:一场静默的革命,告别“C with Classes”
后端