@Override public ClassFilter getClassFilter() { obtainPointcutExpression(); return this; }
@Override public MethodMatcher getMethodMatcher() { obtainPointcutExpression(); return this; }
/** * Return the underlying AspectJ pointcut expression. */ public PointcutExpression getPointcutExpression() { return obtainPointcutExpression(); }
@Override public boolean isRuntime() { return obtainPointcutExpression().mayNeedDynamicTest(); }
@Override public boolean matches(Class<?> targetClass) { PointcutExpression pointcutExpression = obtainPointcutExpression(); try { try { return pointcutExpression.couldMatchJoinPointsInType(targetClass); } catch (ReflectionWorldException ex) { logger.debug("PointcutExpression matching rejected target class - trying fallback expression", ex); // Actually this is still a "maybe" - treat the pointcut as dynamic if we don't know enough yet PointcutExpression fallbackExpression = getFallbackPointcutExpression(targetClass); if (fallbackExpression != null) { return fallbackExpression.couldMatchJoinPointsInType(targetClass); } } } catch (Throwable ex) { logger.debug("PointcutExpression matching rejected target class", ex); } return false; }
@Override public boolean matches(Method method, Class<?> targetClass, Object... args) { obtainPointcutExpression(); ShadowMatch shadowMatch = getTargetShadowMatch(method, targetClass);
try { try { shadowMatch = obtainPointcutExpression().matchesMethodExecution(methodToMatch); shadowMatch = obtainPointcutExpression().matchesMethodExecution(methodToMatch);
@Override public boolean matches(Method method, Class<?> targetClass, boolean hasIntroductions) { obtainPointcutExpression(); ShadowMatch shadowMatch = getTargetShadowMatch(method, targetClass); // Special handling for this, target, @this, @target, @annotation // in Spring - we can optimize since we know we have exactly this class, // and there will never be matching subclass at runtime. if (shadowMatch.alwaysMatches()) { return true; } else if (shadowMatch.neverMatches()) { return false; } else { // the maybe case if (hasIntroductions) { return true; } // A match test returned maybe - if there are any subtype sensitive variables // involved in the test (this, target, at_this, at_target, at_annotation) then // we say this is not a match as in Spring there will never be a different // runtime subtype. RuntimeTestWalker walker = getRuntimeTestWalker(shadowMatch); return (!walker.testsSubtypeSensitiveVars() || walker.testTargetInstanceOfResidue(targetClass)); } }
/** * Return the underlying AspectJ pointcut expression. */ public PointcutExpression getPointcutExpression() { return obtainPointcutExpression(); }
@Override public MethodMatcher getMethodMatcher() { obtainPointcutExpression(); return this; }
@Override public ClassFilter getClassFilter() { obtainPointcutExpression(); return this; }
@Override public boolean isRuntime() { return obtainPointcutExpression().mayNeedDynamicTest(); }
@Override public boolean matches(Class<?> targetClass) { PointcutExpression pointcutExpression = obtainPointcutExpression(); try { try { return pointcutExpression.couldMatchJoinPointsInType(targetClass); } catch (ReflectionWorldException ex) { logger.debug("PointcutExpression matching rejected target class - trying fallback expression", ex); // Actually this is still a "maybe" - treat the pointcut as dynamic if we don't know enough yet PointcutExpression fallbackExpression = getFallbackPointcutExpression(targetClass); if (fallbackExpression != null) { return fallbackExpression.couldMatchJoinPointsInType(targetClass); } } } catch (Throwable ex) { logger.debug("PointcutExpression matching rejected target class", ex); } return false; }
try { try { shadowMatch = obtainPointcutExpression().matchesMethodExecution(methodToMatch); shadowMatch = obtainPointcutExpression().matchesMethodExecution(methodToMatch);
@Override public boolean matches(Method method, Class<?> targetClass, Object... args) { obtainPointcutExpression(); ShadowMatch shadowMatch = getTargetShadowMatch(method, targetClass);
@Override public boolean matches(Method method, Class<?> targetClass, boolean hasIntroductions) { obtainPointcutExpression(); ShadowMatch shadowMatch = getTargetShadowMatch(method, targetClass); // Special handling for this, target, @this, @target, @annotation // in Spring - we can optimize since we know we have exactly this class, // and there will never be matching subclass at runtime. if (shadowMatch.alwaysMatches()) { return true; } else if (shadowMatch.neverMatches()) { return false; } else { // the maybe case if (hasIntroductions) { return true; } // A match test returned maybe - if there are any subtype sensitive variables // involved in the test (this, target, at_this, at_target, at_annotation) then // we say this is not a match as in Spring there will never be a different // runtime subtype. RuntimeTestWalker walker = getRuntimeTestWalker(shadowMatch); return (!walker.testsSubtypeSensitiveVars() || walker.testTargetInstanceOfResidue(targetClass)); } }