AspectJ: @AfterReturning

[亡魂溺海] 提交于 2019-12-12 12:04:53

问题


I've created this pointcut:

@Pointcut("execution(* com.living.commty.boot.resources.*.* (..))")
public void resourcesCut() {}

I'm trying to get the return value after having been returned:

@AfterReturning(pointcut="resourcesCut()", returning="result")
public void afterReturning(JoinPoint joinPoint, Object result)
{
    //...
}

The problem is that it's cutting only 6 advises. However, if I not set returning:

@AfterReturning(pointcut="resourcesCut()")
public void afterReturning(JoinPoint joinPoint)
{
    this.logAfterReturningTrace(joinPoint, null);
}

it's cutting up to 39 advises.

What am I doing wrong?

I'm trying to get all returned values of any "resourcesCut" pointcut execution methods...

来源:https://stackoverflow.com/questions/43676168/aspectj-afterreturning

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!