Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Using AJ to change program flow

The previous posters are correct that you can use around advice to avoid proceeding with the call to the log.

However, the complex string calculation that sets up the argument to log occurs before the call join point, so you will still have the performance cost of performing those. So using advice like this is likely to have little performance gain over a typically logging package, which checks logging levels immediately on method entry.

If you can refactor parts or all of your logging policy into an aspect, you can improve the situation, e.g.,

pointcut stateChange() : call(* Entity+.set*(..));

before() : stateChange() {
    if (isLoggerEnabled()) {
        logger.info("About to change state with "+thisJoinPointStaticPart.getSignature());
    }
}

Ron Bodkin
Chief Technology Officer
New Aspects of Software
o: (415) 824-4690
m: (415) 509-2895


> ------------Original Message------------
> From: jimfcarroll@xxxxxxxxxxxx (Jim Carroll)
> To: aspectj-users@xxxxxxxxxxx
> Date: Mon, Aug-16-2004 6:11 AM
> Subject: Re: [aspectj-users] Using AJ to change program flow
>
> robert kuzelj <robert_kuzelj@xxxxxxxxx> wrote:
> 
> >maybe i didnt understand your question correctly but what about 
> this...
> 
> In fact you did understand it. I'm a newbie to AJ and didn't know how 
> to use 'around' (I had only used 'before' and 'after' previously). 
> Thanks.
> 
> Jim
> 
> 
> __________________________________________________________________
> Switch to Netscape Internet Service.
> As low as $9.95 a month -- Sign up today at 
> http://isp.netscape.com/register
> 
> Netscape. Just the Net You Need.
> 
> New! Netscape Toolbar for Internet Explorer
> Search from anywhere on the Web and block those annoying pop-ups.
> Download now at http://channels.netscape.com/ns/search/install.jsp
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/aspectj-users
> 
> 



Back to the top