Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Sonic ESB class hierarchy causing unwanted multiple invocations of aspect

You're right, of course.  For a while, nothing would happen without that other target() expression, but now it works like this:

   pointcut serviceCall(XQServiceEx svc, XQServiceContext ctx) :
    	call(void XQService.service(XQServiceContext)) &&
    	target(svc) &&
    	args(ctx) &&
    	withincode(* *.service(XQServiceContext)); 

I have to admit, I'm puzzled by the fact that sometimes I need XQService and other times I need XQServiceEx.  But it works, so maybe understanding will come later.  ;-)

Many thanks,
Lee

-----Original Message-----
From: aspectj-users-bounces@xxxxxxxxxxx [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Andy Clement
Sent: Thursday, January 27, 2011 3:24 PM
To: aspectj-users@xxxxxxxxxxx
Subject: Re: [aspectj-users] Sonic ESB class hierarchy causing unwanted multiple invocations of aspect

> Hi, Andy,
>
> It's not that.  I'm just too ignorant to know that there's a higher 
> cost to cflow. :-)
>
> I appreciate you following up.  My requirements are definitely sensitive to peformance impact.  From what you show as possibilities, I guess I didn't understand the difference between within and withincode, either, since I tried within to no avail.
>
> I used your second suggestion (*.service), because it's the actual method I implement, and it works.  Did you literally mean call(...), or was that shorthand for the full call expression?

call(...) was a shorthand for the full expression you were using.

> Also, you left off the other tests in your three choices:
>
>        target(svc) &&
>        target(com.sonicsw.xq.XQService) &&
>        args(ctx) &&

Yep, I was really only showing the syntax for withincode in my snippet, sorry, that could have been clearer.

> Here's what I currently have:
>
>   pointcut serviceCall(XQServiceEx svc, XQServiceContext ctx) :
>        call(void XQService.service(XQServiceContext)) &&
>        target(svc) &&
>        target(com.sonicsw.xq.XQService) &&
>        args(ctx) &&
>        withincode(* *.service(XQServiceContext));
>
> Is there anything I need to change?

It is unusual to see two target()s in an expression like that.  What type do you want the target to be? XQService or XQServiceEx?  It looks like XQServiceEx as that is your parameter type for svc.  If it is XQServiceEx (I assume that implements XQService), then you should delete the target(com.sonicsw.xq.XQService) as it is unnecessary.

Andy
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users


Back to the top