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))"
相关推荐
泡^泡13 小时前
Python数据类型与运算符
开发语言·windows·python
不爱编程的小陈13 小时前
Go语言GMP调度模型深度解析:高并发背后的精妙设计
开发语言·后端·golang
xufengzhu14 小时前
Python库PyMySQL的使用指南
开发语言·python·pip
骄马之死21 小时前
SpringMVC + SpringBoot 核心知识点总结
java·spring boot·后端
GoGeekBaird1 天前
Anthropic技能"(Skills)的经验分享
后端
王码码20351 天前
多台服务器怎么统一看状态?Beszel 轻量监控,搭起来不费事
运维·服务器·后端·安全·阿里云·接口·web
世辰辰辰1 天前
批量修改图片/文本名子
开发语言·python·批量修改文件名
郑洁文1 天前
基于Spring Boot的流浪动物救助网站
java·spring boot·后端·毕设·流浪动物救助
指令集梦境1 天前
Cursor + Spring Boot实战:从零写一个RESTful API
spring boot·后端·restful
myenjoy_11 天前
MQTT 与 Sparkplug B——从车间到云端的最后一公里
网络·python