Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] pointcut on annotated methods

Hi all,

I am not used to annotation mechanisms. So I would like to know why my annotated methods are not woven. here is my example :

-------------------------------------------------------------------
import java.lang.annotation.*;

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface WritingMethod {}
--------------------------------------------------------------------
pointcut writingMethodCalled(Object o):
       execution(@WritingMethod void *(*)) &&
       args(o);

void around(Object o): writingMethodCalled(o) {
       // this is not executed
       proceed(o);
   }
----------------------------------------------------------------------
@WritingMethod
   public void saveBean(Object obj) {
       System.out.println("Saved object: " + obj);
   }

Thanks in advance,
Jonathan Clairembault


Back to the top