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))"
相关推荐
陈随易4 小时前
Postman 被曝自动往 Claude Code 和 Codex 装插件
前端·后端·程序员
belldeep5 小时前
python:genesis-world, Genesis-Embodied-AI
人工智能·python·ai·genesis
云-缩影5 小时前
拆解 AI 图像生成应用的后端架构:ECS、OSS 和大模型 API 怎么配合
java·spring boot·后端
benchmark_cc6 小时前
A 股、港股、美股如何建立统一的标的主数据格式?
开发语言·python·数据分析·pandas·量化交易·股票数据·quantdash
维克兜率天7 小时前
【维克】趋势型CTA:期货市场的“追涨杀跌“
人工智能·python
考虑考虑7 小时前
Posrgresql恢复.backup文件
数据库·后端·postgresql
无奈何杨7 小时前
风控决策系统决策流,策略模式,权重、顺序、投票、最坏
后端
AI开源软件7 小时前
SpringBoot3+Vue3 财务管理系统如何设计:从业务单据到总账的模块划分
spring boot·vue3·领域建模·会计凭证·ruoyi office·业财协同·财务系统设计
取名真是7 小时前
Python 算法知识点从基础到进阶
开发语言·python·算法
梦想不只是梦与想7 小时前
PyTorch、CPU、GPU、CUDA
人工智能·pytorch·python·深度学习·机器学习·cuda