我创造了这个方面:
@Pointcut("execution(* com.living.commty.boot.resources.*.* (..))")
public void resourcesCut() {}
我试图在他们返回后执行:
@AfterReturning(pointcut="resourcesCut()", returning="result")
public void afterReturning(JoinPoint joinPoint, Object result)
{
this.logAfterReturningTrace(joinPoint, result);
}
我的课程是:
package com.living.commty.boot.resources;
public class EmailResources {
@Inject private ConfigurationResources configurationResources;
@Inject protected TokenResources cipheringResources;
public String buildURI(String id, byte[] token) throws URISyntaxException
{
return "";
}
public byte[] decodeParameter(String value)
{
return "";
}
public void sendActivationMail(User user) throws MailGenerationException
{
}
}
然而,它们永远不会到达。
然而,如果我添加@Before
:
@Before("resourcesCut()")
public void beforeCreate(JoinPoint joinPoint) {
this.logBeforeTrace(joinPoint);
}
它到达了!
ECLIPSE
正如您可以看到这张图片: