Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Pointcut advice within advice of another pointcut

Thanks Davi, Fintan,

Your explanations did help. As a matter of fact sometime after sending
out the question I realized I could have taken the approach of
including the method within the advice itself. That has worked well
for me.

Regards,

Sarthak

On 1/31/07, Conway. Fintan (IT Solutions) <Fintan.Conway@xxxxxx> wrote:
Hi Sarthak,

The easiest thing to do is to move the code in the advice for pointcutB
into its own method and then call that method from within the advice for
pointcutB.  This should work as long as this code does not include
"proceed()" which must be run within an advice AFAIK.  Then call this
method from the advice for pointcutA.

HTH,

Fintan

-----Original Message-----
From: aspectj-users-bounces@xxxxxxxxxxx
[mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Sarthak Grover
Sent: 31 January 2007 01:37
To: aspectj-users@xxxxxxxxxxx
Subject: [aspectj-users] Pointcut advice within advice of another
pointcut


Hi,

I have a question regarding calling one advice from within another:

Conceptually my program is working like this:

boolean varA = methodA();

if (varA == true)
 {
 methodB();
 }

else ;


I am trying to prevent execution of methodB() and run another method
instead.

I have a pointcutA defined which captures the boolean value of varA and
another pointcutB which captures execution of methodB().

Ideally I want to call the advice for pointcutB whenever pointcutA is
captured.

I am not sure if this is the right/feasible approach for doing this and
would appreciate your advice in this regards on how to approach the
problem.

Thanks,

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


* ** *** ** * ** *** ** * ** *** ** *
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed.
Any views or opinions presented are solely those of the author, and do not necessarily  represent those of ESB.
If you have received this email in error please notify the sender.

Although ESB scans e-mail and attachments for viruses, it does not guarantee
that either are virus-free and accepts no liability for any damage sustained
as a result of viruses.

* ** *** ** * ** *** ** * ** *** ** *

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



Back to the top