I got a solution.
Is this a correct way or there is a better way for solving this issue, please 
tell.

    pointcut setterPointcut(Object input): within(pkg.*) && args(input) && 
execution(*void* jsSet_*(*));    
    pointcut setterPointcut1(Object input): within(pkg.*) && args(input) && 
execution(*Object* jsSet_*(*));    


    void around(Object input) : setterPointcut(input){
        if (input != null) {
            System.out.println(input);
            proceed(input);
            
        }
    }

    Object around(Object input) : setterPointcut1(input){
        if (input != null) {
            System.out.println(input + " 2 ");
            proceed(input);
        }
        return null;
    }


Thanks
Rajat




________________________________
From: Rajat Gupta <[email protected]>
To: aspect-J <[email protected]>
Sent: Fri, April 16, 2010 3:56:14 PM
Subject: [aspectj-users] around advice and return type mismatch ?


Hi All, 

File for this example are attached.
The main problem is the around advice, how should i call that around advice?

I want to insert put around advice on these both following methods, 

     public void jsSet_print(String xyz) throws Exception, IOException 

    public Object jsSet_print3(String xyz) throws Exception, IOException

so i created a pointcut,  i think should be 
    pointcut setterPointcut(Object input): within(pkg.*) && args(input) && 
execution(* jsSet_*(*));    
to match with both.

now by doing this advice
    void around(Object input) : setterPointcut(input){

it gave the error (runs fine though).

I had also tried with, 
    Object around(Object input) : setterPointcut(input){

please suggest how should i do it so that both the methods has the aspect 
inserted.


Thanks
Rajat


      
_______________________________________________
aspectj-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Reply via email to