Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] AspectJ precedence

Hi,
Ok I think set precedence of order of weaving but unless the .java file got the code it may not be applicable to the generated byte code by the first aspect.
But is there a way i can weave to a java class though Aspect1 and then weave Aspect2 based on the changes / introduction made by aspect1.

Thanks,
Vinodh



On Tue, 26 Feb 2008 vinodh subbiah wrote :
>Hi All,
>  Im having 2 aspects and I want to set a precedence between them
>
>I have a java class Foo
>I have a aspect    FooAspect ( have method m1() declared on class Foo
>I have a logger aspect LogAspect
>
>Now if i try setting the precedence Im not able to see any logging on method m1 when it is called.
>
>Is there any way i can set this ..
>
>Thanks
>Vinodh
>
>Below is some of the code i got from .class file generated.
>
>Here showConditons which declared on Class has the tracing ,but I
>addingObject(..) methods which are added using the Aspect into the class are not surronded with the Trace .
>So Im not able to see the trace if any.
>Any help appreaciated.
>
>Thanks again :)
>
>I set the precedence in another aspect like
>declare precedence : CEAspect,TraceAspect ;
>So i first add the methods to the Class FOO and then surrond it with trace.
>
>
>Showing the crosscuting with TraceAspect
>  public void showConditions()
>  {
>              TraceAspect.aspectOf().ajc$before$com.xuaspect_TraceAspect$1$b314f86e(ajc$tjp_1);
>                printConditions();
>                  TraceAspect.aspectOf().ajc$afterReturning$com.xuaspect_TraceAspect$2$b314f86e(ajc$tjp_1);
>  }
>
>Only method injected no trace aspect added
>
>    public void addingObject(IlrAlphaMem ilralphamem, Object obj)
>    {
>        CEAspect.ajc$interMethod$com.xuaspect_CEAspect$com.xuaspect_CEvents$addingObject(this, ilralphamem, obj);
>    }
>
>    public void addingObject(IlrDefaultDiscMem ilrdefaultdiscmem, Object obj)
>    {
>        CEAspect.ajc$interMethod$com.xuaspect_CEAspect$com.xuaspect_CEvents$addingObject(this, ilrdefaultdiscmem, obj);
>    }
>
>    public void addingObject(IlrDefaultJoinMem ilrdefaultjoinmem, Object obj)
>    {
>        CEAspect.ajc$interMethod$com.xuaspect_CEAspect$com.xuaspect_CEvents$addingObject(this, ilrdefaultjoinmem, obj);
>    }
>
>Vinodh Subbiah,
>580 Laforet Street,Apt 14
>Windsor N9C3G8
>Canada
>Ph 519-971-7847
>_______________________________________________
>aspectj-users mailing list
>aspectj-users@xxxxxxxxxxx
>https://dev.eclipse.org/mailman/listinfo/aspectj-users

Vinodh Subbiah,
580 Laforet Street,Apt 14
Windsor N9C3G8
Canada
Ph 519-971-7847

Times Better Job

Back to the top