【发布时间】:2015-01-23 09:37:59
【问题描述】:
我有一个与How to create an aspect on an Interface Method that extends from A "Super" Interface 非常相似的问题,但我的保存方法在一个抽象超类中。
结构如下-
接口:
public interface SuperServiceInterface {
ReturnObj save(ParamObj);
}
public interface ServiceInterface extends SuperServiceInterface {
...
}
实现:
public abstract class SuperServiceImpl implements SuperServiceInterface {
public ReturnObj save(ParamObj) {
...
}
}
public class ServiceImpl implements ServiceInterface extends SuperServiceImpl {
...
}
我想检查对ServiceInterface.save 方法的任何调用。
我目前的切入点是这样的:
@Around("within(com.xyz.api.ServiceInterface+) && execution(* save(..))")
public Object pointCut(final ProceedingJoinPoint call) throws Throwable {
}
当 save 方法放入 ServiceImpl 时会触发,但不会在 SuperServiceImpl 中触发。
我的周围切入点缺少什么?
【问题讨论】:
标签: java aspectj spring-aop pointcut