日常提交

This commit is contained in:
2022-12-19 01:34:09 +08:00
parent 0f6c62e459
commit 3dec6613e8
2 changed files with 40 additions and 3 deletions

View File

@@ -47,14 +47,14 @@
- execution匹配目标方法的执行可以在括号中接收一个函数签名包含返回类型、函数名和函数参数类型
```java
// 被@JointPoint注解标注的方法必须具有void的返回类型
@JoinPoint("execution(* Point.*(..))")
@Pointcut("execution(* Point.*(..))")
void methodInjected() {
}
```
- within:匹配声明在某一特定类中的方法
```java
@JoinPoint("within(Point)")
@Pointcut("within(Point)")
```
- this匹配生成的代理对象为该类型的一个实例
- target匹配目标对象为该类型的一个实例
@@ -65,7 +65,7 @@
- @annotation执行的方法具有指定注解
- Spring AOP同样支持将JoinPoint匹配为具有特定name的Spring bean对象
```java
@JoinPoint("bean(nameA) || bean(nameB))")
@Pointcut("bean(nameA) || bean(nameB))")
```
- ## Spring AOP中的Advice
- Advice和Pointcut Expresion相关联主要可以分为before、after、around等种类