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

> 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


Back to the top