Hi,
I have a aspect which declares an annotation based pointcut :
I have a spring bean which is abstract and parametrized :Code:"@annotation(my.package.MyAnnotation)"
This bean declares an "update" method :Code:public abstract class MyAbstractBeanBOImpl<T extends MyGenericType> extends AbstractBOImpl<T> implements MyAbstractBeanBO {
I have an typed spring bean which extends MyAbstractBeanBOImpl, and overrides the update method :Code:public T update(T entity) {
My beans are configured to expose proxies and to proxy target classes with CGLIB.Code:@MyAnnotation("XXX") @Override public MyTypedType update(MyTypedType entity) {
AOP does not trigger when I call the "update" method from ImageBOImpl.
AOP does trigger if I annotate the "update" method from MyAbstractBeanBOImpl with @MyAnnotation.
This is a issue to me as I want to pass a particular value to my annotation in the child class.
Is this normal behavior ? Why does AOP rely on the parent method signature ?
I took a look at Spring Security because I noticed that this does not behave like this. In that case, an interceptor registers all eligible methods and save the @Secured annotation attribute in a cache, which is read when the aspect is called. I wish I had not to create such mechanism...
Any hint ?


Reply With Quote