Skip to main content

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

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

Times Job change

Back to the top