[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [aspectj-users] Join Point Static Part
|
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 <maddalab@xxxxxxxxx> 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
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>