How to find if the current joinPoint in an advices matches a joinpoint expression
What i'd like to do is when an aspect is invoked based on the pointcut being matched, perform several tasks, then if the aspect is being invoked because of a select few of these pointcuts being matched, perform an additional task.
Something like this
Code:
public boolean matches(ProceedingJoinPoint joinPoint, Pointcut pointcut);
i've found the method AspectJExpressionPointcut.matches(Method, Class<?>) that seems to get close however it seems to falsely return true when the pointcut expression is a bean pointcut and this is testing a method and class that have nothing to do with it
Code:
<aop:pointcut id="beanPointcut" expression="bean(someBean)"/>
So, to rephrase my question, how can you tell which pointcut is the one that matched causing the current aspect to be invoked?
Thanks
Jeff