problem description
writes a section to intercept methods that contain specified annotations. The
runtime finds that if a subclass An inherits the abstract parent class B and implements the parent"s abstract method, adding a specified comment to the subclass"s rewrite method, it finds that the method cannot be intercepted when called.
who can give me an explanation and a solution?
related codes
//
public @interface Profiling {
}
//
public class B {
public abstract void foo();
}
//
public class A extent B {
// Profiling
@Profiling
@Override
public void foo() {
// do something
}
}
//
public class Aspect {
@Pointcut("@annotation(com.base.Profiling)")
private void pointCut(){
}
@Around("pointCut()")
public Object around(ProceedingJoinPoint pjp) {
// do something
}
}