0

我有一个要求是从切入点实现中获取截获的方法的参数值,如下所示。

截取方法:

public void execute(Object mapValues)throws Throwable{
....
}

并在方面实施

@AfterThrowing(pointcut = "execution(*com.AdhocJob.execute(..))", throwing="ex")
        public void afterThrowing(JoinPoint pjp,Throwable ex) {
           MethodSignature signature = (MethodSignature) pjp.getSignature();
....
}

是否可以在 afterThrowing 方法中获取“mapValues”参数的实例。有人可以说明一下吗。

4

1 回答 1

0

您可以使用 JoinPoint 参数中的 getArgs() 方法:

JoinPoint.getArgs()

正如蜘蛛鲍里斯的评论

于 2018-01-30T05:05:22.680 回答