[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ews.eclipse.technology.aspectj] Why my aspect doesn't work? (Annotation and load time weaving)

Hi,
I've coded a very simple logging aspect:

@Aspect
public abstract class Sequence {

    @Pointcut("execution(* *.*(..)) || execution(*.new(..)))")
    void traceMethods() {
    };

    @Before("traceMethods()")
    public void beforeTraceMethod() {
        System.out.println("Before");
    }

    @After("traceMethods()")
    public void afterTraceMethod() {
        System.out.println("After");
    }
}

And then enabled it for load time weaving with aop.xml:

<aspectj>

   <aspects>
     <aspect name="my.company.app.model.Sequence" />
     <include within="my.company.app.model.Sequence" />
   </aspects>

   <weaver options="-verbose">
     <include within="my.company.app..*" />
   </weaver>

</aspectj>

And then I run it with the veaving classloader enabled. I can see it
use my configuration file and weave all of my classes
(since I did enable the verbose output),
but the advices are never called?

I really don't understand why...

Cheers
Andrea Aime