深入理解Spring---Aop(一)--------Advice

BeforeAdvice:

MethodBeforeAdvice 中有before作为回调,主要就是这个before方法,我们来看看before方法

	@Override
	public void before(Method method, Object[] args, @Nullable Object target) throws Throwable {
		invokeAdviceMethod(getJoinPointMatch(), null, null);
	}

before方法的实现在Advice中被配置到目标方法后,会在调用目标方法时被回调.具体的调用参数

Method对象:目标方法的反射对象

Object[]:对象数组,这个对象数组,这个对象数组中包含目标方法的输入参数.

例:CountingBeforeAdvice看这个参数

afterReturningAdvice:

ThrowsAdvice:异常的次数

猜你喜欢

转载自blog.csdn.net/weixin_40403930/article/details/89350805