|
|
|
@ -618,28 +618,35 @@ public abstract class AbstractAspectJAdvice implements Advice, AspectJPrecedence |
|
|
|
* @return the invocation result |
|
|
|
* @return the invocation result |
|
|
|
* @throws Throwable in case of invocation failure |
|
|
|
* @throws Throwable in case of invocation failure |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
protected Object invokeAdviceMethod( |
|
|
|
protected @Nullable Object invokeAdviceMethod(@Nullable JoinPointMatch jpMatch, |
|
|
|
@Nullable JoinPointMatch jpMatch, @Nullable Object returnValue, @Nullable Throwable ex) |
|
|
|
@Nullable Object returnValue, @Nullable Throwable ex) throws Throwable { |
|
|
|
throws Throwable { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return invokeAdviceMethodWithGivenArgs(argBinding(getJoinPoint(), jpMatch, returnValue, ex)); |
|
|
|
return invokeAdviceMethodWithGivenArgs(argBinding(getJoinPoint(), jpMatch, returnValue, ex)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// As above, but in this case we are given the join point.
|
|
|
|
// As above, but in this case we are given the join point.
|
|
|
|
protected Object invokeAdviceMethod(JoinPoint jp, @Nullable JoinPointMatch jpMatch, |
|
|
|
protected @Nullable Object invokeAdviceMethod(JoinPoint jp, @Nullable JoinPointMatch jpMatch, |
|
|
|
@Nullable Object returnValue, @Nullable Throwable t) throws Throwable { |
|
|
|
@Nullable Object returnValue, @Nullable Throwable t) throws Throwable { |
|
|
|
|
|
|
|
|
|
|
|
return invokeAdviceMethodWithGivenArgs(argBinding(jp, jpMatch, returnValue, t)); |
|
|
|
return invokeAdviceMethodWithGivenArgs(argBinding(jp, jpMatch, returnValue, t)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected Object invokeAdviceMethodWithGivenArgs(Object[] args) throws Throwable { |
|
|
|
protected @Nullable Object invokeAdviceMethodWithGivenArgs(Object[] args) throws Throwable { |
|
|
|
Object[] actualArgs = args; |
|
|
|
Object[] actualArgs = args; |
|
|
|
if (this.aspectJAdviceMethod.getParameterCount() == 0) { |
|
|
|
if (this.aspectJAdviceMethod.getParameterCount() == 0) { |
|
|
|
actualArgs = null; |
|
|
|
actualArgs = null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
Object aspectInstance = this.aspectInstanceFactory.getAspectInstance(); |
|
|
|
|
|
|
|
if (aspectInstance.equals(null)) { |
|
|
|
|
|
|
|
// Possibly a NullBean -> simply proceed if necessary.
|
|
|
|
|
|
|
|
if (getJoinPoint() instanceof ProceedingJoinPoint pjp) { |
|
|
|
|
|
|
|
return pjp.proceed(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
} |
|
|
|
try { |
|
|
|
try { |
|
|
|
ReflectionUtils.makeAccessible(this.aspectJAdviceMethod); |
|
|
|
ReflectionUtils.makeAccessible(this.aspectJAdviceMethod); |
|
|
|
return this.aspectJAdviceMethod.invoke(this.aspectInstanceFactory.getAspectInstance(), actualArgs); |
|
|
|
return this.aspectJAdviceMethod.invoke(aspectInstance, actualArgs); |
|
|
|
} |
|
|
|
} |
|
|
|
catch (IllegalArgumentException ex) { |
|
|
|
catch (IllegalArgumentException ex) { |
|
|
|
throw new AopInvocationException("Mismatch on arguments to advice method [" + |
|
|
|
throw new AopInvocationException("Mismatch on arguments to advice method [" + |
|
|
|
|