Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-dev] @Around advice and JoinPoint.EnclosingStaticPart

I've been experimenting with Around adivce.

Specifically I'm interested in displaying the caller/callee for a particular
callee.

I have defined the following advice and pointcut.

@Around("executionPointCut(pjp)")
public Object aroundTest(JoinPoint.EnclosingStaticPart jpesp,
ProceedingJoinPoint pjp) throws Throwable           {
		System.out.println(jpesp.getSignature() + " -> " + pjp.getSignature());
		return pjp.proceed();
}

@Pointcut("execution(* *(..))")
public static boolean executionPointCut(ProceedingJoinPoint jp) {
    return true;
}

However when I run my test program, EnclosingStaticPart signature is the
same as ProceedingJoinPoints.  My understanding is EnclosingStaticPart and
ProceedingJoinPoint map to the caller and callee respectively.  I don't get
why output below doesn't reflect this.

void a.b.c.Test.eligibleMethod() -> void a.b.c.Test..eligibleMethod()

Looking for some insight.



--
View this message in context: http://aspectj.2085585.n4.nabble.com/Around-advice-and-JoinPoint-EnclosingStaticPart-tp4650678.html
Sent from the AspectJ - dev mailing list archive at Nabble.com.


Back to the top