我有以下简单的服务:
20 = HMENU
20 {
special = language
special.value = 0,1,2,3,4,5
current = 1
wrap = <ul class="nav navbar-nav navbar-right pull-right" role="menu">|</ul>
1 = TMENU
1 {
wrap = <ul class="dropdown-menu">|</ul>
NO = 1
NO {
allWrap = <li class="lang eng">|</li> || <li class="lang nl">|</li> || <li class="lang fr">|</li> || <li class="lang de">|</li> || <li class="lang es">|</li> || <li class="lang pt">|</li>
ATagParams =
ATagBeforeWrap = 1
linkWrap = <span>|</span>
}
#ACT < .NO
ACT = 1
ACT {
allWrap = <li class="dropdown language-menu lang eng">|</li>
}
}
}
实现我的简单界面:
@Service
public class TestServiceImpl implements TestService {
@Override
public void countExternal(Integer arg1) {
System.out.println("test - lock external");
count(arg1, new Integer(1));
}
public void count(Integer arg1, Integer arg2) {
System.out.println("test - lock internal");
}
}
以下是计数方法中用于进行验证的方面:
public interface TestService {
void countExternal(Integer arg1);
}
在我的Spring配置中,我已经包含了autoproxying:
@Aspect
@Component
public class TestAdvicer {
@Around("execution(* count(..))")
public Object advice(ProceedingJoinPoint joinPoint) throws Throwable {
// do som magic here
return joinPoint.proceed();
}
}
不幸的是,从@EnableAspectJAutoProxy(proxyTargetClass = true)
方法调用TestAdvicer
方法后,我的count
永远不会被执行。 countExternal
方法在Proxy对象上执行,因为该建议没有运行。
您知道如何在Proxy对象上运行我的建议吗?解决这个问题的最佳方法是什么?