【发布时间】:2013-01-22 20:43:58
【问题描述】:
我是 aop 编程的新手,我对 @Around 建议有很大的疑问。 我有一个 Maven 项目 - aspectjrt 和 aspectjweaver 1.7.1 - 春天 3.2.0
根据官方指南 (http://static.springsource.org/srin.../html/aop.html),我已插入到我的 applicationContext 和示例方面
如果我使用指定的@Pointcut 尝试@AfterReturning @Before @After @AfterTrowing 一切正常,但如果我使用@Around 建议不起作用。
这是切入点,它围绕着建议
@Pointcut("execution(*PersonDbService.findPersonDiplomatici(..))")
private void dbFindOperationNoArgs() {}
@Around("dbFindOperationNoArgs()")
public Object aroundAdv(ProceedingJoinPoint joinPoint) throws Throwable {
// start stopwatch
Object retVal = joinPoint.proceed();
// stop stopwatch
return retVal;
}
这对我来说很奇怪,因为所有其他建议注释都有效
【问题讨论】: