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))"
相关推荐
摇滚侠14 小时前
《Spring Boot 3:高级与架构设计》第 3 章 Bean 的全生命周期原理 Bean 的全生命周期概览 阅读笔记 9
spring boot·笔记·后端
墨家句子14 小时前
AnythingLLM 搭本地知识库:文档问答不准怎么调
linux·后端
知守观14 小时前
OBS 同名文件互相覆盖,客户拿错了别人的报告:一次文件串号的排查与重构
java·后端
特立独行的猫A14 小时前
Godot 游戏编辑器移植鸿蒙 PC:难度与可行性分析
后端·harmonyos
郝学胜_神的一滴14 小时前
AI 编程智能体 01:普通程序员的下一个逆天改命风口
人工智能·python
章鱼哥197114 小时前
DeepSeek Harness 插件开发新手教程
后端·deepseek
特立独行的猫A14 小时前
C++ 异步编程:std::future 与 std::promise 详解(含 RPC 客户端实现实践)
c++·后端
Anymous14 小时前
支付为什么要验两次签?——从渠道验签到服务间信任边界与 RSA2
后端
zh路西法14 小时前
【ResNet18】从图像到视觉特征:卷积神经网络如何理解图像
pytorch·python·神经网络·cnn·resnet·resnet18
南归北隐15 小时前
Spring AI Alibaba Graph框架实现Tools工具调用
java·后端·spring·spring ai·spring ai tools