Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] checkpoint

I got it. :)

Thanks.


From: Ramnivas Laddad <ramnivas@xxxxxxxxx>
Reply-To: aspectj-users@xxxxxxxxxxx
To: aspectj-users@xxxxxxxxxxx
Subject: Re: [aspectj-users] checkpoint
Date: Wed, 14 May 2003 20:05:40 -0700 (PDT)

You need to use control-flow based pointcut. Try the following
modified advice:

>   String around(String tablename,Vector values):
>      insert_checkpoint(tablename,values)
       && !cflowbelow(insert_checkpoint(String, Vector))
>   {
>     .....
>   }

This will prevent advice being applied to insert called
from insertExp().

-Ramnivas

--- lily lily <lixiaojiao@xxxxxxxxxxx> wrote:
> Hi:
> I want to write an aspect which will be executed before the insert
> and
> insertExp method.
>
> The insert method is like this:
> public String insert(String tablename, Vector values)
> {
>   ...
> }
>
> The insertExp methos is like this:
> public String insertExp(String tablename, Vector values)
> {
>   ...
>   insert(table,values); //call the insert method inside insertExp
> ...
> }
>
> And the aspect is like this:
> aspect AccessControl
> {
>
>   pointcut insert_checkpoint(String tablename,Vector values):
>     within(tableBean) && execution(public String
> tableBean.insert(String,Vector))
>     || execution(public String tableBean.insertExp(String,Vector)) &&
>
> args(tablename,values);
>
>   String around(String tablename,Vector values):
> insert_checkpoint(tablename,values)
>   {
>     .....
>   }
>
> }
>
> The problem is that,the aspect will be executed before every insert
> and
> insertExp method,
> including the one which is called inside the insertExp method. But
> this is
> not what I want. I do not
> want the insert method being called inside insertExp method to be
> disturbed.
> That is , the aspect
> should be executed only before insertExp, but not before the insert
> method
> within the insertEXp body.
>
> Is there any idea? I know there must be a way to solve it.
>
> Thank you for your help.
>
> Lily
>
> _________________________________________________________________
> Protect your PC - get McAfee.com VirusScan Online
> http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/aspectj-users


__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/aspectj-users

_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail



Back to the top