[aspectwerkz-user] Eclipse integration using annotations

Vinicius Carvalho <[email protected]> Tue, 19 Jul 2005 22:57:21 -0300
Newsgroups gmane.comp.java.aspectwerkz.user
Message-ID <[email protected]>
Hello there! I've just started with AspectWerkz (I have some
background with AspectJ and AJDT and Spring AOP).

Well, so I built the simplest example on eclipse 3.1 final:

Here it is:

package com.cs.aspects;

public class HelloWorld {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		HelloWorld helloWorld = new HelloWorld();
		helloWorld.greet();
	}
	
	public void greet(){
		System.out.println("Hello World");
	}

}

package com.cs.aspects;

import org.codehaus.aspectwerkz.annotation.Before;
import org.codehaus.aspectwerkz.definition.Pointcut;
import org.codehaus.aspectwerkz.annotation.Expression;
import org.codehaus.aspectwerkz.joinpoint.JoinPoint;

public class HelloAspect {
	@Expression("* com.cs.aspects.HelloWorld.greet(...)")
	Pointcut myPointcut;
	@Before("myPointcut")
	public void beforeGreet(JoinPoint joinPoint) throws Throwable{
		System.out.println(joinPoint.getCallee().getClass().getName());
	}

}

Well eclipse is not marking the method that has the joinpoint. I was
wondering if even if I'm using annotations, should I need an aop.xml
file? I tried with one and also no success. What am I missing here?

Regards