@Override public Annotation[] synthesizeDeclared() { return ArrayUtils.concat(childContext.synthesizeDeclared(), thisContext.synthesizeDeclared()); }
@Override public Annotation[] synthesizeAll() { return ArrayUtils.concat(childContext.synthesizeAll(), thisContext.synthesizeAll()); }
/** * Resolves the interceptors for a method for {@link Introduction} advise. For {@link Introduction} advise * any {@link Around} advise interceptors are applied first * * @param beanContext Bean Context * @param method The method * @param interceptors The array of interceptors * @return The filtered array of interceptors */ @Internal public static Interceptor[] resolveIntroductionInterceptors(BeanContext beanContext, ExecutableMethod<?, ?> method, Interceptor... interceptors) { instrumentAnnotationMetadata(beanContext, method); Interceptor[] aroundInterceptors = resolveAroundInterceptors(beanContext, method, interceptors); Interceptor[] introductionInterceptors = resolveInterceptorsInternal(method, Introduction.class, interceptors); if (introductionInterceptors.length == 0) { if (method.hasStereotype(Adapter.class)) { introductionInterceptors = new Interceptor[] { new AdapterIntroduction(beanContext, method) }; } else { throw new IllegalStateException("At least one @Introduction method interceptor required, but missing. Check if your @Introduction stereotype annotation is marked with @Retention(RUNTIME) and @Type(..) with the interceptor type. Otherwise do not load @Introduction beans if their interceptor definitions are missing!"); } } return ArrayUtils.concat(aroundInterceptors, introductionInterceptors); }
@Override public @Nonnull String[] getBeanNamesForAnnotation(@Nonnull Class<? extends Annotation> annotationType) { final String[] beanNamesForAnnotation = super.getBeanNamesForAnnotation(annotationType); final Collection<BeanDefinition<?>> beanDefinitions = beanContext.getBeanDefinitions(Qualifiers.byStereotype(annotationType)); return ArrayUtils.concat(beansToNames(beanDefinitions), beanNamesForAnnotation); }
/** * Resolves the interceptors for a method for {@link Introduction} advise. For {@link Introduction} advise * any {@link Around} advise interceptors are applied first * * @param beanContext Bean Context * @param method The method * @param interceptors The array of interceptors * @return The filtered array of interceptors */ @Internal public static Interceptor[] resolveIntroductionInterceptors(BeanContext beanContext, ExecutableMethod<?, ?> method, Interceptor... interceptors) { instrumentAnnotationMetadata(beanContext, method); Interceptor[] aroundInterceptors = resolveAroundInterceptors(beanContext, method, interceptors); Interceptor[] introductionInterceptors = resolveInterceptorsInternal(method, Introduction.class, interceptors); if (introductionInterceptors.length == 0) { if (method.hasStereotype(Adapter.class)) { introductionInterceptors = new Interceptor[] { new AdapterIntroduction(beanContext, method) }; } else { throw new IllegalStateException("At least one @Introduction method interceptor required, but missing. Check if your @Introduction stereotype annotation is marked with @Retention(RUNTIME) and @Type(..) with the interceptor type. Otherwise do not load @Introduction beans if their interceptor definitions are missing!"); } } return ArrayUtils.concat(aroundInterceptors, introductionInterceptors); }
/** * Resolves the interceptors for a method for {@link Introduction} advise. For {@link Introduction} advise * any {@link Around} advise interceptors are applied first * * @param beanContext Bean Context * @param method The method * @param interceptors The array of interceptors * @return The filtered array of interceptors */ @Internal public static Interceptor[] resolveIntroductionInterceptors(BeanContext beanContext, ExecutableMethod<?, ?> method, Interceptor... interceptors) { instrumentAnnotationMetadata(beanContext, method); Interceptor[] aroundInterceptors = resolveAroundInterceptors(beanContext, method, interceptors); Interceptor[] introductionInterceptors = resolveInterceptorsInternal(method, Introduction.class, interceptors); if (introductionInterceptors.length == 0) { if (method.hasStereotype(Adapter.class)) { introductionInterceptors = new Interceptor[] { new AdapterIntroduction(beanContext, method) }; } else { throw new IllegalStateException("At least one @Introduction method interceptor required, but missing. Check if your @Introduction stereotype annotation is marked with @Retention(RUNTIME) and @Type(..) with the interceptor type. Otherwise do not load @Introduction beans if their interceptor definitions are missing!"); } } return ArrayUtils.concat(aroundInterceptors, introductionInterceptors); }