【发布时间】:2014-11-07 07:03:16
【问题描述】:
我正在使用 spring aspect -around 建议; 对于 super.method() 或类间方法调用,我无法调用我的方面代码; 这是我的代码示例。
//My aspect Class
@Aspect
public class MyAspect {
@Around("execution(* in.test.project.service.myservice.create(..))")
public Object logAround(ProceedingJoinPoint joinPoint) throws Throwable {
// .
//my logic
// .
}
public interface Myservice{
void create(Myclass entity);
void createObject(Myclass entity);
}
class myserviceImpl implements Myservice{
public void create(Myclass entity) {
// TODO Auto-generated method stub
}
void createObject(Myclass entity){
create(entity);
}
}
class Mycontroller {
void test(Myclass entity) {
Myservice myservice = new myserviceImplimplements();
// calls MyAspect code
myservice.create(entity);
// MyAspect not called
myservice.createObject(entity);
}
}
【问题讨论】:
标签: java spring-aop