[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[List Home]
|
Re: [aspectj-users] Problems to set up an annotation based pointcut with Spring3 and Aspectj 1.6
|
- From: Andy Clement <andrew.clement@xxxxxxxxx>
- Date: Mon, 21 Mar 2011 09:20:00 -0700
- Delivered-to: aspectj-users@eclipse.org
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=cnlkC5qBs1v8kOGtNnnbgC/D8JNVOUfcxHH+tnw1OSE=; b=hbfCB7BqdIP9r/esasVUnt0hNXODgX5mXJKPe/jo5cKaf9K4hhECYU/XmSudXtRBHB 13aDMMFdEs7nrlsR+kWbtMA924Dj+9/u5yuu0vbNjtgcj3FRQLKtPVr5KywhKtkM+TNT mAuQyljttAwDQRa+Cf0oy7oQALLcBaEZrDtcM=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=NoIpguvI8rUQDCW+XGuPBNQDIGvQ5ZEwVXGoeQ4q8+PuUFsRyJLtnxUk4iXafrQTF4 D8jzghc5Jt9aS16xjHP1QBFOtxNSBOkFx5etR6ogdbbl2u6G+y4CxSUu10trJNA2iwZO 3DIKXMzJSm3HPf+kJ8REcOEUiREAT/MmfxVwA=
Is your annotation in a package by any chance? In annotation style
pointcuts (@Pointcut) you need to fully qualify type names. I only
say this because your pointcut looks OK.
Are you using SpringAOP to wire it up right now or just testing by
having it all in an AspectJ project? (Under AJDT in eclipse)
Andy
On 21 March 2011 03:14, jelramzy <jelramzy@xxxxxxxxx> wrote:
> Hi All,
>
> well i am experiencing real troubles to test an AspectJ annotated poincut to
> work on Spring 3.
> The goal is to create a poincut that deals with methods annotated with a
> given customized annotation.
>
> Here is the annotation (simple one really)
>
>
> @Retention(RetentionPolicy.RUNTIME)
> @Target(ElementType.METHOD)
> public @interface MyAnnotation {
> String name();
> }
>
> Here is my Aspect @Aspect
>
> @Aspect
> public class MyPoinCut {
>
> @Pointcut(value = "execution (@MyAnnotation * *.*(..))")
> public void anyTaskToPerform() {
> /* do domething */
> }
>
>
> @Around("anyTaskToPerform()")
> public Object performCallWhenException(ProceedingJoinPoint joinPoint)
> throws Throwable {
> /* do something here too */
> }}
>
> Now, here is my main class including the annotation in its methods:
>
>
> public class SomeJob {
>
> @MyAnnotation
> public letsdoit(){
> /* business */
> }
>
> }
>
> Ii have just a unit test calling the letsdoit method of the SomeJob class,
> nothing special!
>
> The problem is that it seems that the expression given to the poincut seem
> to be wrong and i don't know how to fix it , thus, my pointcut is just
> ignored and never called !!
>
> can i have some help please?
>
> Thanks
>
> --
> View this message in context: http://aspectj.2085585.n4.nabble.com/Problems-to-set-up-an-annotation-based-pointcut-with-Spring3-and-Aspectj-1-6-tp3393103p3393103.html
> Sent from the AspectJ - users mailing list archive at Nabble.com.
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>