Search in sources :

Example 1 with AnnotationMatchingPointcut

use of org.springframework.aop.support.annotation.AnnotationMatchingPointcut 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;
}
Also used : ComposablePointcut(org.springframework.aop.support.ComposablePointcut) Pointcut(org.springframework.aop.Pointcut) AnnotationMatchingPointcut(org.springframework.aop.support.annotation.AnnotationMatchingPointcut) AnnotationMatchingPointcut(org.springframework.aop.support.annotation.AnnotationMatchingPointcut) ComposablePointcut(org.springframework.aop.support.ComposablePointcut)

Example 2 with AnnotationMatchingPointcut

use of org.springframework.aop.support.annotation.AnnotationMatchingPointcut in project spring-framework by spring-projects.

the class MethodValidationPostProcessor method afterPropertiesSet.

@Override
public void afterPropertiesSet() {
    Pointcut pointcut = new AnnotationMatchingPointcut(this.validatedAnnotationType, true);
    this.advisor = new DefaultPointcutAdvisor(pointcut, createMethodValidationAdvice(this.validator));
}
Also used : Pointcut(org.springframework.aop.Pointcut) AnnotationMatchingPointcut(org.springframework.aop.support.annotation.AnnotationMatchingPointcut) AnnotationMatchingPointcut(org.springframework.aop.support.annotation.AnnotationMatchingPointcut) DefaultPointcutAdvisor(org.springframework.aop.support.DefaultPointcutAdvisor)

Example 3 with AnnotationMatchingPointcut

use of org.springframework.aop.support.annotation.AnnotationMatchingPointcut 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;
}
Also used : ComposablePointcut(org.springframework.aop.support.ComposablePointcut) Pointcut(org.springframework.aop.Pointcut) AnnotationMatchingPointcut(org.springframework.aop.support.annotation.AnnotationMatchingPointcut) AnnotationMatchingPointcut(org.springframework.aop.support.annotation.AnnotationMatchingPointcut) ComposablePointcut(org.springframework.aop.support.ComposablePointcut)

Aggregations

Pointcut (org.springframework.aop.Pointcut)3 AnnotationMatchingPointcut (org.springframework.aop.support.annotation.AnnotationMatchingPointcut)3 ComposablePointcut (org.springframework.aop.support.ComposablePointcut)2 DefaultPointcutAdvisor (org.springframework.aop.support.DefaultPointcutAdvisor)1