use of cn.taketoday.aop.support.AnnotationMatchingPointcut in project today-framework by TAKETODAY.
the class AspectAutoProxyCreator method addCandidateAdvisors.
private void addCandidateAdvisors(BeanDefinition aspectDef, @Nullable Method aspectMethod, Stream<MergedAnnotation<Advice>> adviceAttributes) {
adviceAttributes.forEach(advice -> {
MethodInterceptor interceptor = getInterceptor(aspectDef, aspectMethod, advice);
if (log.isTraceEnabled()) {
log.trace("Found Interceptor: [{}]", interceptor);
}
// Annotations
Class<? extends Annotation>[] annotations = advice.getClassArray(MergedAnnotation.VALUE);
if (ObjectUtils.isNotEmpty(annotations)) {
for (Class<? extends Annotation> annotation : annotations) {
AnnotationMatchingPointcut matchingPointcut = AnnotationMatchingPointcut.forMethodAnnotation(annotation);
DefaultPointcutAdvisor pointcutAdvisor = new DefaultPointcutAdvisor(matchingPointcut, interceptor);
annotationAdvisors.add(pointcutAdvisor);
}
}
});
}
Aggregations