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))"
相关推荐
☼←安于亥时→❦7 分钟前
Playwright 安装与使用
python·playwright
间彧8 分钟前
云原生,与云计算、云服务的区别与联系
后端
大佬,救命!!!22 分钟前
python实现象棋
开发语言·python·学习笔记·pygame·少儿编程·记录成长
棉猴23 分钟前
《pygame中Sprite类实现多帧动画》注-通过多张序列帧显示动画2-2
开发语言·python·游戏·游戏程序·pygame
知兀26 分钟前
【Spring/SpringBoot】<dependencyManagement> + import 导入能继承父maven项目的所有依赖,类似parent
spring boot·spring·maven
烛阴32 分钟前
Python数据可视化:从零开始教你绘制精美雷达图
前端·python
276695829237 分钟前
朴朴超市小程序分析
java·python·小程序·node·sign·朴朴超市·sign-v2
canonical_entropy1 小时前
最小信息表达:从误解到深层理解的五个关键点
后端·架构
郝开1 小时前
Spring Boot 2.7.18(最终 2.x 系列版本):版本概览;兼容性与支持;升级建议;脚手架工程搭建
java·spring boot·后端