use of org.springframework.aop.support.ComposablePointcut in project druid by alibaba.
the class StatAnnotationAdvisor method buildPointcut.
protected Pointcut buildPointcut() {
Pointcut cpc = new AnnotationMatchingPointcut(Stat.class, true);
Pointcut mpc = AnnotationMatchingPointcut.forMethodAnnotation(Stat.class);
ComposablePointcut result = new ComposablePointcut(cpc).union(mpc);
return result;
}
use of org.springframework.aop.support.ComposablePointcut in project spring-framework by spring-projects.
the class AbstractAspectJAdvice method buildSafePointcut.
/**
* Build a 'safe' pointcut that excludes the AspectJ advice method itself.
* @return a composable pointcut that builds on the original AspectJ expression pointcut
* @see #getPointcut()
*/
public final Pointcut buildSafePointcut() {
Pointcut pc = getPointcut();
MethodMatcher safeMethodMatcher = MethodMatchers.intersection(new AdviceExcludingMethodMatcher(this.aspectJAdviceMethod), pc.getMethodMatcher());
return new ComposablePointcut(pc.getClassFilter(), safeMethodMatcher);
}
use of org.springframework.aop.support.ComposablePointcut in project spring-framework by spring-projects.
the class AsyncAnnotationAdvisor method buildPointcut.
/**
* Calculate a pointcut for the given async annotation types, if any.
* @param asyncAnnotationTypes the async annotation types to introspect
* @return the applicable Pointcut object, or {@code null} if none
*/
protected Pointcut buildPointcut(Set<Class<? extends Annotation>> asyncAnnotationTypes) {
ComposablePointcut result = null;
for (Class<? extends Annotation> asyncAnnotationType : asyncAnnotationTypes) {
Pointcut cpc = new AnnotationMatchingPointcut(asyncAnnotationType, true);
Pointcut mpc = AnnotationMatchingPointcut.forMethodAnnotation(asyncAnnotationType);
if (result == null) {
result = new ComposablePointcut(cpc);
} else {
result.union(cpc);
}
result = result.union(mpc);
}
return result;
}
Aggregations