Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Question on disabling aspect...

Ah... that makes sense. I have used "!cflow(adviceexecution())" to prevent the same thing from happening from within the aspect's execution flow. Essentially then "adviceexecution()" is the same thing as "execution(..)", only from the dynamic context of an aspect advise. I hadn't connected the dots.

Thanks!

-Kyle

----- Original Message ----
From: Eric Bodden <eric.bodden@xxxxxxxxxxxxxx>
To: aspectj-users@xxxxxxxxxxx
Sent: Friday, November 16, 2007 1:59:54 PM
Subject: Re: [aspectj-users] Question on disabling aspect...

Yes, you can use &&!cflow(execution(* diagnosticMethod())).

Eric

On 16/11/2007, Kyle Lomeli <kyllerss_009@xxxxxxxxx> wrote:
>
> I am trying to find out if AspectJ is capable of addressing the following
> issue. I have a certain set of methods that are all intercepted by an aspect
> I created. The aspect intercepts all methods and logs some information
> pertaining to each method invocation.
>
> method1() -> logs something
> method2() -> logs something else
> method3() -> logs my pijamas
>
> I have another method that when invoked may make a call to either of these
> methods. However, any methods invoked from this special method should not
> trigger the logging aspect.
>
> diagnosticMethod() -> calls
>                                -> method1() -> logs nothing
>                                -> method2() -> logs nothing
>                                -> method3() -> logs nothing
>
> Is there any way of defining a pointcut such that any method invocations
> resulting from diagnosticMethod() will NOT trigger the aspect? I would
> rather not have to resort to manually enabling and disabling the aspect
> based on a ThreadLocal variable.
>
> Thanks for any pointers.
>
> -Kyle
>
>
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
>


--
Eric Bodden
Sable Research Group
McGill University, Montréal, Canada
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users


Back to the top