Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] syntax for combining two @AfterReturning

You could do:

 pointcut = "(execution(public * func1( .. )) || execution(public *
func2(..)))  && args(id)"

Andy

On 22 August 2012 15:03, Srinivas S Tamvada <tssrinivas@xxxxxxxxx> wrote:
> Hi
>
> I have several point cuts , like so
>
> @AfterReturning(
>             pointcut = "execution(public   * func1( .. ))  " +    " &&
> args(id)   " ,         returning="name")
>     public void provideAdviseUponExecutionOfF1 ( int id , JoinPoint jp,
> String name) {
>             print  //  employeeid is  id, and employeename is name
> }
>
> @AfterReturning(
>             pointcut = "execution(public   * func2( .. ))  " +    " &&
> args(id)   " ,            returning="name")
>     public void provideAdviseUponExecutionOfF2 ( int id , JoinPoint jp,
> String name) {
>             print //  department ID  is  id, and departmentname is name
> }
>
> What I want is :
>
> @AfterReturning(  either of the above )  {
>
>    if ( jp.getSignature().getName())   equals func2    then print  //
> department is  id, and departmentname is name
>
>    else print      //  employeeid is  id, and employeename is name
>
> }
>
> I cannot replace the function names func1 and func2 by *, since I have got
> many methods and I don't want to intercept every method. That is,
> wildcarding the function names will not work .
>
> What is the syntax for combining pointcuts ?
>
> Thank You.
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>


Back to the top