我有一个非常相似的问题: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
. 我的周围切入点缺少什么?