Hi Bhaskar,

I am using a simple around advice. The argument is printed. Is this
simiilar to what you are looking for ?

        pointcut test() : call( * com.test.TestClass.test1(..) );

        void around() : test(){
                
                System.out.println( thisJoinPoint.getArgs()[ 0 ] );
                
                proceed();
        }


        public void test1( int i){
        }

Thanks,
Mohan

On Thu, May 27, 2010 at 3:35 AM, Bhaskar Maddala <[email protected]> wrote:
> Hello,
>
>    I am trying to write a logging aspect. Something that logs method
> arguments when the method executed. I was looking up the reflection
> apis for aspectj and did not find anything in either StaticPart,
> ProceedingJoinPoint or Signature that would give me the method
> arguments names.
>
> As as example
>   �...@pointcut("execution(@Unit * *(..)) && @annotation(u) &&
> @within(ct) && this(cinstance)")
>    public void unit(Auditable cinstance, Container ct, Unit u) {
>    }
>
>   �...@around(unit(ct, u))
>    public void do(ProceedingJoinPoint pjp, Auditable cinstance,
> Container ct, Unit u){
>      pjp.getMethodArgNames(); //???
>    }
>
>  Any ideas on where I can get the method argument names?
>
> Thanks
> Bhaskar
> _______________________________________________
> aspectj-users mailing list
> [email protected]
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
_______________________________________________
aspectj-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Reply via email to