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))"
相关推荐
言乐637 分钟前
Python语音检索
开发语言·python·django·virtualenv·pygame
泡茶喝茶写代码1 小时前
A股量化数据工程:从 REST 接口到策略信号(第 1 篇):指数列表与实时行情接入
java·python·股票数据api·股票数据·股票数据api接口·股票api数据接口·股票量化数据接口
happylifetree1 小时前
Python34-35:核心语法-流程控制语句-循环-综合案例
python
不才不才不不才1 小时前
Spring 源码系列(29): 20 道高频面试题源码级解析合集
java·后端·spring
吃饱了得干活1 小时前
Agent 的记忆与工具:从上下文窗口到 MCP
python·agent·mcp
索隆zoro1 小时前
Army 的可插拔架构:army-jdbc 与方言模块
java·后端
燐妤2 小时前
LangGraph-复习总览
python·ai·面试·agent·学习方法·langgraph
小蒜学长2 小时前
校园社团招新网站的设计与实现(代码+数据库+LW)
java·数据库·spring boot·后端·校园社团招新网站
尹人入圣2 小时前
市面上IP驱动产业新场景新工具
运维·网络·python·tcp/ip
打工仔折腾 AI3 小时前
从BPE到SentencePiece:Transformer分词原理与Python实战对比
android·人工智能·python·深度学习·langchain·transformer·ai agent 实战