Search in sources :

Example 1 with BeanDefinitionReference

use of io.micronaut.inject.BeanDefinitionReference in project micronaut-core by micronaut-projects.

the class DefaultBeanContext method getBeanDefinitions.

@SuppressWarnings("unchecked")
@Override
@NonNull
public Collection<BeanDefinition<?>> getBeanDefinitions(@Nullable Qualifier<Object> qualifier) {
    if (qualifier == null) {
        return Collections.emptyList();
    }
    if (LOG.isDebugEnabled()) {
        LOG.debug("Finding candidate beans for qualifier: {}", qualifier);
    }
    // first traverse component definition classes and load candidates
    Collection candidates;
    if (!beanDefinitionsClasses.isEmpty()) {
        Stream<BeanDefinitionReference> reduced = qualifier.reduce(Object.class, beanDefinitionsClasses.stream());
        Stream<BeanDefinition> candidateStream = qualifier.reduce(Object.class, reduced.map(ref -> ref.load(this)).filter(candidate -> candidate.isEnabled(this)));
        candidates = candidateStream.collect(Collectors.toList());
    } else {
        return Collections.emptyList();
    }
    if (CollectionUtils.isNotEmpty(candidates)) {
        filterProxiedTypes(candidates, true, true, null);
        filterReplacedBeans(null, candidates);
    }
    return candidates;
}
Also used : OrderUtil(io.micronaut.core.order.OrderUtil) Arrays(java.util.Arrays) BeanDestroyedEventListener(io.micronaut.context.event.BeanDestroyedEventListener) Internal(io.micronaut.core.annotation.Internal) DependencyInjectionException(io.micronaut.context.exceptions.DependencyInjectionException) NonUniqueBeanException(io.micronaut.context.exceptions.NonUniqueBeanException) SoftServiceLoader(io.micronaut.core.io.service.SoftServiceLoader) Future(java.util.concurrent.Future) Map(java.util.Map) DefaultImplementation(io.micronaut.context.annotation.DefaultImplementation) Prototype(io.micronaut.context.annotation.Prototype) CustomScopeRegistry(io.micronaut.context.scope.CustomScopeRegistry) Ordered(io.micronaut.core.order.Ordered) ArgumentUtils(io.micronaut.core.util.ArgumentUtils) TypeConverter(io.micronaut.core.convert.TypeConverter) Singleton(jakarta.inject.Singleton) Set(java.util.Set) ExecutableMethodProcessor(io.micronaut.context.processor.ExecutableMethodProcessor) BeanConfiguration(io.micronaut.inject.BeanConfiguration) FieldInjectionPoint(io.micronaut.inject.FieldInjectionPoint) EventListener(java.util.EventListener) Stream(java.util.stream.Stream) BeanPreDestroyEvent(io.micronaut.context.event.BeanPreDestroyEvent) BeanCreationException(io.micronaut.context.exceptions.BeanCreationException) AnnotationValue(io.micronaut.core.annotation.AnnotationValue) ProxyBeanDefinition(io.micronaut.inject.ProxyBeanDefinition) ApplicationEventListener(io.micronaut.context.event.ApplicationEventListener) BeanFactory(io.micronaut.inject.BeanFactory) Replaces(io.micronaut.context.annotation.Replaces) AnnotationMetadataProvider(io.micronaut.core.annotation.AnnotationMetadataProvider) DisabledBeanException(io.micronaut.context.exceptions.DisabledBeanException) ArrayList(java.util.ArrayList) LinkedHashMap(java.util.LinkedHashMap) Nullable(io.micronaut.core.annotation.Nullable) ReturnType(io.micronaut.core.type.ReturnType) Argument(io.micronaut.core.type.Argument) ConversionService(io.micronaut.core.convert.ConversionService) Qualified(io.micronaut.inject.qualifiers.Qualified) BeanDestructionException(io.micronaut.context.exceptions.BeanDestructionException) MethodExecutionHandle(io.micronaut.inject.MethodExecutionHandle) NoSuchBeanException(io.micronaut.context.exceptions.NoSuchBeanException) BeanDefinitionMethodReference(io.micronaut.inject.BeanDefinitionMethodReference) ForkJoinPool(java.util.concurrent.ForkJoinPool) Named(io.micronaut.core.naming.Named) PropertyPlaceholderResolver(io.micronaut.context.env.PropertyPlaceholderResolver) BeanDefinition(io.micronaut.inject.BeanDefinition) Parallel(io.micronaut.context.annotation.Parallel) ValidatedBeanDefinition(io.micronaut.inject.ValidatedBeanDefinition) BeanContextException(io.micronaut.context.exceptions.BeanContextException) ListIterator(java.util.ListIterator) ArrayUtils(io.micronaut.core.util.ArrayUtils) LoggerFactory(org.slf4j.LoggerFactory) GenericTypeUtils(io.micronaut.core.reflect.GenericTypeUtils) StreamUtils(io.micronaut.core.util.StreamUtils) ConcurrentLinkedHashMap(io.micronaut.core.util.clhm.ConcurrentLinkedHashMap) PropertyResolver(io.micronaut.core.value.PropertyResolver) CreatedBean(io.micronaut.context.scope.CreatedBean) BeanCreatedEventListener(io.micronaut.context.event.BeanCreatedEventListener) Method(java.lang.reflect.Method) AnyQualifier(io.micronaut.inject.qualifiers.AnyQualifier) Executable(io.micronaut.context.annotation.Executable) ClassUtils(io.micronaut.core.reflect.ClassUtils) ConstructorInjectionPoint(io.micronaut.inject.ConstructorInjectionPoint) Context(io.micronaut.context.annotation.Context) BeanDestroyedEvent(io.micronaut.context.event.BeanDestroyedEvent) Predicate(java.util.function.Predicate) Collection(java.util.Collection) UsedByGeneratedCode(io.micronaut.core.annotation.UsedByGeneratedCode) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) Qualifiers(io.micronaut.inject.qualifiers.Qualifiers) BeanIdentifier(io.micronaut.inject.BeanIdentifier) Collectors(java.util.stream.Collectors) Indexes(io.micronaut.core.annotation.Indexes) ResourceLoader(io.micronaut.core.io.ResourceLoader) AnnotationProcessor(io.micronaut.context.processor.AnnotationProcessor) DisposableBeanDefinition(io.micronaut.inject.DisposableBeanDefinition) Objects(java.util.Objects) StringUtils(io.micronaut.core.util.StringUtils) List(java.util.List) AnnotationUtil(io.micronaut.core.annotation.AnnotationUtil) BeanCreatedEvent(io.micronaut.context.event.BeanCreatedEvent) Annotation(java.lang.annotation.Annotation) Optional(java.util.Optional) BeanDefinitionReference(io.micronaut.inject.BeanDefinitionReference) InjectionPoint(io.micronaut.inject.InjectionPoint) ConcurrentLinkedQueue(java.util.concurrent.ConcurrentLinkedQueue) BeanPreDestroyEventListener(io.micronaut.context.event.BeanPreDestroyEventListener) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) HashMap(java.util.HashMap) BeanInitializedEventListener(io.micronaut.context.event.BeanInitializedEventListener) Function(java.util.function.Function) ExecutableMethod(io.micronaut.inject.ExecutableMethod) BeanCreationContext(io.micronaut.context.scope.BeanCreationContext) BeanInstantiationException(io.micronaut.context.exceptions.BeanInstantiationException) HashSet(java.util.HashSet) Primary(io.micronaut.context.annotation.Primary) CustomScope(io.micronaut.context.scope.CustomScope) InitializingBeanDefinition(io.micronaut.inject.InitializingBeanDefinition) ConfigurationReader(io.micronaut.context.annotation.ConfigurationReader) Secondary(io.micronaut.context.annotation.Secondary) MutableConvertibleValues(io.micronaut.core.convert.value.MutableConvertibleValues) Infrastructure(io.micronaut.context.annotation.Infrastructure) Logger(org.slf4j.Logger) Iterator(java.util.Iterator) ApplicationEventPublisher(io.micronaut.context.event.ApplicationEventPublisher) AnnotationMetadataResolver(io.micronaut.core.annotation.AnnotationMetadataResolver) BeanDefinitionValidator(io.micronaut.inject.validation.BeanDefinitionValidator) AdvisedBeanType(io.micronaut.inject.AdvisedBeanType) ShutdownEvent(io.micronaut.context.event.ShutdownEvent) ValueResolver(io.micronaut.core.value.ValueResolver) BeanType(io.micronaut.inject.BeanType) Consumer(java.util.function.Consumer) NonNull(io.micronaut.core.annotation.NonNull) ClassPathResourceLoader(io.micronaut.core.io.scan.ClassPathResourceLoader) StartupEvent(io.micronaut.context.event.StartupEvent) MethodInjectionPoint(io.micronaut.inject.MethodInjectionPoint) ParametrizedBeanFactory(io.micronaut.inject.ParametrizedBeanFactory) Provider(jakarta.inject.Provider) CollectionUtils(io.micronaut.core.util.CollectionUtils) AnnotationMetadata(io.micronaut.core.annotation.AnnotationMetadata) TypeConverterRegistrar(io.micronaut.core.convert.TypeConverterRegistrar) Comparator(java.util.Comparator) Collections(java.util.Collections) Order(io.micronaut.core.annotation.Order) BeanDefinitionReference(io.micronaut.inject.BeanDefinitionReference) Collection(java.util.Collection) ProxyBeanDefinition(io.micronaut.inject.ProxyBeanDefinition) BeanDefinition(io.micronaut.inject.BeanDefinition) ValidatedBeanDefinition(io.micronaut.inject.ValidatedBeanDefinition) DisposableBeanDefinition(io.micronaut.inject.DisposableBeanDefinition) InitializingBeanDefinition(io.micronaut.inject.InitializingBeanDefinition) NonNull(io.micronaut.core.annotation.NonNull)

Example 2 with BeanDefinitionReference

use of io.micronaut.inject.BeanDefinitionReference in project micronaut-core by micronaut-projects.

the class DefaultBeanContext method findBeanCandidates.

/**
 * Find bean candidates for the given type.
 *
 * @param <T>               The bean generic type
 * @param resolutionContext The current resolution context
 * @param beanType          The bean type
 * @param filterProxied     Whether to filter out bean proxy targets
 * @param predicate         The predicate to filter candidates
 * @return The candidates
 */
@SuppressWarnings("unchecked")
@NonNull
protected <T> Collection<BeanDefinition<T>> findBeanCandidates(@Nullable BeanResolutionContext resolutionContext, @NonNull Argument<T> beanType, boolean filterProxied, Predicate<BeanDefinition<T>> predicate) {
    ArgumentUtils.requireNonNull("beanType", beanType);
    final Class<T> beanClass = beanType.getType();
    if (LOG.isDebugEnabled()) {
        LOG.debug("Finding candidate beans for type: {}", beanType);
    }
    // first traverse component definition classes and load candidates
    Collection<BeanDefinitionReference> beanDefinitionsClasses;
    if (indexedTypes.contains(beanClass)) {
        beanDefinitionsClasses = beanIndex.get(beanClass);
        if (beanDefinitionsClasses == null) {
            beanDefinitionsClasses = Collections.emptyList();
        }
    } else {
        beanDefinitionsClasses = this.beanDefinitionsClasses;
    }
    if (!beanDefinitionsClasses.isEmpty()) {
        Set<BeanDefinition<T>> candidates = new HashSet<>();
        for (BeanDefinitionReference reference : beanDefinitionsClasses) {
            if (!reference.isCandidateBean(beanType) || !reference.isEnabled(this, resolutionContext)) {
                continue;
            }
            BeanDefinition<T> loadedBean;
            try {
                loadedBean = reference.load(this);
            } catch (Throwable e) {
                throw new BeanContextException("Error loading bean [" + reference.getName() + "]: " + e.getMessage(), e);
            }
            if (!loadedBean.isCandidateBean(beanType)) {
                continue;
            }
            if (predicate != null && !predicate.test(loadedBean)) {
                continue;
            }
            if (!loadedBean.isEnabled(this, resolutionContext)) {
                continue;
            }
            candidates.add(loadedBean);
        }
        if (!candidates.isEmpty()) {
            if (filterProxied) {
                filterProxiedTypes(candidates, true, false, null);
            }
            filterReplacedBeans(resolutionContext, candidates);
        }
        if (LOG.isDebugEnabled()) {
            LOG.debug("Resolved bean candidates {} for type: {}", candidates, beanType);
        }
        return candidates;
    } else {
        if (LOG.isDebugEnabled()) {
            LOG.debug("No bean candidates found for type: {}", beanType);
        }
        return Collections.emptySet();
    }
}
Also used : BeanContextException(io.micronaut.context.exceptions.BeanContextException) BeanDefinitionReference(io.micronaut.inject.BeanDefinitionReference) ProxyBeanDefinition(io.micronaut.inject.ProxyBeanDefinition) BeanDefinition(io.micronaut.inject.BeanDefinition) ValidatedBeanDefinition(io.micronaut.inject.ValidatedBeanDefinition) DisposableBeanDefinition(io.micronaut.inject.DisposableBeanDefinition) InitializingBeanDefinition(io.micronaut.inject.InitializingBeanDefinition) HashSet(java.util.HashSet) NonNull(io.micronaut.core.annotation.NonNull)

Example 3 with BeanDefinitionReference

use of io.micronaut.inject.BeanDefinitionReference in project micronaut-core by micronaut-projects.

the class RequiresCondition method matches.

@Override
public boolean matches(ConditionContext context) {
    AnnotationMetadataProvider component = context.getComponent();
    boolean isBeanReference = component instanceof BeanDefinitionReference;
    List<AnnotationValue<Requires>> requirements = annotationMetadata.getAnnotationValuesByType(Requires.class);
    if (!requirements.isEmpty()) {
        // here we use AnnotationMetadata to avoid loading the classes referenced in the annotations directly
        if (isBeanReference) {
            for (AnnotationValue<Requires> requirement : requirements) {
                processPreStartRequirements(context, requirement);
                if (context.isFailing()) {
                    return false;
                }
            }
        } else {
            for (AnnotationValue<Requires> requires : requirements) {
                processPostStartRequirements(context, requires);
                if (context.isFailing()) {
                    return false;
                }
            }
        }
    }
    return true;
}
Also used : Requires(io.micronaut.context.annotation.Requires) BeanDefinitionReference(io.micronaut.inject.BeanDefinitionReference) AnnotationValue(io.micronaut.core.annotation.AnnotationValue) AnnotationMetadataProvider(io.micronaut.core.annotation.AnnotationMetadataProvider)

Example 4 with BeanDefinitionReference

use of io.micronaut.inject.BeanDefinitionReference in project helidon by oracle.

the class MicronautCdiExtension method processTypes.

/**
 * Construct a list of Micronaut interceptors to execute on each CDI method.
 * In case a Micronaut bean definition is available for the CDI bean (which should be for application, as
 * the CDI annotation processor should be used, and it adds CDI beans as Micronaut beans), the information
 * is combined from Micronaut and CDI bean definitions.
 *
 * @param event CDI event
 */
@SuppressWarnings("unchecked")
void processTypes(@Priority(PLATFORM_AFTER) @Observes ProcessAnnotatedType<?> event) {
    Set<Class<?>> classInterceptors = new HashSet<>();
    Map<Method, Set<Class<?>>> allMethodInterceptors = new HashMap<>();
    List<MicronautBean> miBeans = unprocessedBeans.remove(event.getAnnotatedType().getJavaClass());
    if (miBeans != null && miBeans.size() > 0) {
        BeanDefinitionReference<?> miBean = findMicronautBeanDefinition(miBeans);
        // add all interceptors that are seen based on Micronaut
        findMicronautInterceptors(classInterceptors, allMethodInterceptors, miBean);
    }
    // find all annotations that have meta annotation Around and collect their Type list to add as interceptors
    addMicronautInterceptors(classInterceptors, event.getAnnotatedType().getAnnotations());
    // for each method, find the same (Around, collect Type), and add the interceptor binding for Micronaut interceptors
    // CDI interceptors will be automatic
    event.configureAnnotatedType().methods().forEach(method -> {
        Method javaMethod = method.getAnnotated().getJavaMember();
        Set<Class<?>> methodInterceptors = allMethodInterceptors.computeIfAbsent(javaMethod, it -> new HashSet<>());
        methodInterceptors.addAll(classInterceptors);
        addMicronautInterceptors(methodInterceptors, method.getAnnotated().getAnnotations());
        if (!methodInterceptors.isEmpty()) {
            // now I have a set of micronaut interceptors that are needed for this method
            method.add(MicronautIntercepted.Literal.INSTANCE);
            Set<Class<? extends MethodInterceptor<?, ?>>> interceptors = new HashSet<>();
            methodInterceptors.forEach(it -> interceptors.add((Class<? extends MethodInterceptor<?, ?>>) it));
            methods.computeIfAbsent(javaMethod, theMethod -> MethodInterceptorMetadata.create(method.getAnnotated(), executableMethodCache.get(theMethod))).addInterceptors(interceptors);
        }
    });
}
Also used : Dependent(jakarta.enterprise.context.Dependent) Around(io.micronaut.aop.Around) Observes(jakarta.enterprise.event.Observes) ApplicationScoped(jakarta.enterprise.context.ApplicationScoped) HashMap(java.util.HashMap) AtomicReference(java.util.concurrent.atomic.AtomicReference) ExecutableMethod(io.micronaut.inject.ExecutableMethod) ArrayList(java.util.ArrayList) Level(java.util.logging.Level) HashSet(java.util.HashSet) SoftServiceLoader(io.micronaut.core.io.service.SoftServiceLoader) ApplicationContext(io.micronaut.context.ApplicationContext) Extension(jakarta.enterprise.inject.spi.Extension) ProcessAnnotatedType(jakarta.enterprise.inject.spi.ProcessAnnotatedType) BeforeBeanDiscovery(jakarta.enterprise.inject.spi.BeforeBeanDiscovery) MethodInterceptor(io.micronaut.aop.MethodInterceptor) Map(java.util.Map) PLATFORM_AFTER(jakarta.interceptor.Interceptor.Priority.PLATFORM_AFTER) BeanConfigurator(jakarta.enterprise.inject.spi.configurator.BeanConfigurator) Priority(jakarta.annotation.Priority) LinkedList(java.util.LinkedList) Method(java.lang.reflect.Method) Initialized(jakarta.enterprise.context.Initialized) PLATFORM_BEFORE(jakarta.interceptor.Interceptor.Priority.PLATFORM_BEFORE) Iterator(java.util.Iterator) PropertySource(io.micronaut.context.env.PropertySource) Collection(java.util.Collection) ServiceDefinition(io.micronaut.core.io.service.ServiceDefinition) Set(java.util.Set) Qualifiers(io.micronaut.inject.qualifiers.Qualifiers) AdvisedBeanType(io.micronaut.inject.AdvisedBeanType) Config(org.eclipse.microprofile.config.Config) Logger(java.util.logging.Logger) Collectors(java.util.stream.Collectors) BeforeDestroyed(jakarta.enterprise.context.BeforeDestroyed) Objects(java.util.Objects) List(java.util.List) Type(io.micronaut.context.annotation.Type) Stream(java.util.stream.Stream) AfterBeanDiscovery(jakarta.enterprise.inject.spi.AfterBeanDiscovery) Annotation(java.lang.annotation.Annotation) AnnotationMetadata(io.micronaut.core.annotation.AnnotationMetadata) BeanDefinition(io.micronaut.inject.BeanDefinition) Comparator(java.util.Comparator) Qualifier(jakarta.inject.Qualifier) BeanDefinitionReference(io.micronaut.inject.BeanDefinitionReference) HashSet(java.util.HashSet) Set(java.util.Set) HashMap(java.util.HashMap) ExecutableMethod(io.micronaut.inject.ExecutableMethod) Method(java.lang.reflect.Method) MethodInterceptor(io.micronaut.aop.MethodInterceptor) HashSet(java.util.HashSet)

Example 5 with BeanDefinitionReference

use of io.micronaut.inject.BeanDefinitionReference in project helidon by oracle.

the class MicronautCdiExtension method afterBeanDiscovery.

/**
 * Add all (not yet added) Micronaut beans for injection as long as they are singletons.
 *
 * @param event CDI event
 */
@SuppressWarnings({ "rawtypes", "unchecked" })
void afterBeanDiscovery(@Priority(PLATFORM_BEFORE) @Observes AfterBeanDiscovery event) {
    event.addBean().addType(ApplicationContext.class).id(MICRONAUT_BEAN_PREFIX + "context").scope(ApplicationScoped.class).produceWith(instance -> micronautContext.get());
    // add the remaining Micronaut beans
    for (var entry : unprocessedBeans.entrySet()) {
        Class<?> beanType = entry.getKey();
        List<MicronautBean> beans = entry.getValue();
        List<? extends BeanDefinitionReference<?>> refs = List.of();
        if (beans.size() > 1) {
            // first make sure these are singletons; if not, ignore
            refs = beans.stream().map(MicronautBean::definitionRef).filter(it -> !it.getBeanType().getName().endsWith("$Intercepted")).filter(BeanDefinitionReference::isSingleton).collect(Collectors.toList());
        }
        // primary
        event.addBean().addType(beanType).id(MICRONAUT_BEAN_PREFIX + beanType.getName()).scope(Dependent.class).produceWith(instance -> micronautContext.get().getBean(beanType));
        if (refs.size() > 1) {
            // we must care about qualifiers
            for (var ref : refs) {
                AnnotationMetadata annotationMetadata = ref.getAnnotationMetadata();
                List<Class<? extends Annotation>> qualifiers = annotationMetadata.getAnnotationTypesByStereotype(Qualifier.class);
                Annotation[] synthesized = new Annotation[qualifiers.size()];
                io.micronaut.context.Qualifier[] mq = new io.micronaut.context.Qualifier[qualifiers.size()];
                for (int i = 0; i < qualifiers.size(); i++) {
                    Annotation annotation = annotationMetadata.synthesize(qualifiers.get(i));
                    synthesized[i] = annotation;
                    if (annotation != null) {
                        mq[i] = Qualifiers.byAnnotation(annotation);
                    }
                }
                io.micronaut.context.Qualifier composite = Qualifiers.byQualifiers(mq);
                BeanConfigurator<Object> newBean = event.addBean().addType(beanType).id(MICRONAUT_BEAN_PREFIX + ref.getBeanDefinitionName()).scope(Dependent.class).produceWith(instance -> micronautContext.get().getBean(beanType, composite));
                for (Annotation annotation : synthesized) {
                    newBean.addQualifier(annotation);
                }
            }
        }
    }
    unprocessedBeans.clear();
}
Also used : Dependent(jakarta.enterprise.context.Dependent) Around(io.micronaut.aop.Around) Observes(jakarta.enterprise.event.Observes) ApplicationScoped(jakarta.enterprise.context.ApplicationScoped) HashMap(java.util.HashMap) AtomicReference(java.util.concurrent.atomic.AtomicReference) ExecutableMethod(io.micronaut.inject.ExecutableMethod) ArrayList(java.util.ArrayList) Level(java.util.logging.Level) HashSet(java.util.HashSet) SoftServiceLoader(io.micronaut.core.io.service.SoftServiceLoader) ApplicationContext(io.micronaut.context.ApplicationContext) Extension(jakarta.enterprise.inject.spi.Extension) ProcessAnnotatedType(jakarta.enterprise.inject.spi.ProcessAnnotatedType) BeforeBeanDiscovery(jakarta.enterprise.inject.spi.BeforeBeanDiscovery) MethodInterceptor(io.micronaut.aop.MethodInterceptor) Map(java.util.Map) PLATFORM_AFTER(jakarta.interceptor.Interceptor.Priority.PLATFORM_AFTER) BeanConfigurator(jakarta.enterprise.inject.spi.configurator.BeanConfigurator) Priority(jakarta.annotation.Priority) LinkedList(java.util.LinkedList) Method(java.lang.reflect.Method) Initialized(jakarta.enterprise.context.Initialized) PLATFORM_BEFORE(jakarta.interceptor.Interceptor.Priority.PLATFORM_BEFORE) Iterator(java.util.Iterator) PropertySource(io.micronaut.context.env.PropertySource) Collection(java.util.Collection) ServiceDefinition(io.micronaut.core.io.service.ServiceDefinition) Set(java.util.Set) Qualifiers(io.micronaut.inject.qualifiers.Qualifiers) AdvisedBeanType(io.micronaut.inject.AdvisedBeanType) Config(org.eclipse.microprofile.config.Config) Logger(java.util.logging.Logger) Collectors(java.util.stream.Collectors) BeforeDestroyed(jakarta.enterprise.context.BeforeDestroyed) Objects(java.util.Objects) List(java.util.List) Type(io.micronaut.context.annotation.Type) Stream(java.util.stream.Stream) AfterBeanDiscovery(jakarta.enterprise.inject.spi.AfterBeanDiscovery) Annotation(java.lang.annotation.Annotation) AnnotationMetadata(io.micronaut.core.annotation.AnnotationMetadata) BeanDefinition(io.micronaut.inject.BeanDefinition) Comparator(java.util.Comparator) Qualifier(jakarta.inject.Qualifier) BeanDefinitionReference(io.micronaut.inject.BeanDefinitionReference) Dependent(jakarta.enterprise.context.Dependent) ApplicationScoped(jakarta.enterprise.context.ApplicationScoped) AnnotationMetadata(io.micronaut.core.annotation.AnnotationMetadata) Annotation(java.lang.annotation.Annotation) ApplicationContext(io.micronaut.context.ApplicationContext) BeanDefinitionReference(io.micronaut.inject.BeanDefinitionReference) Qualifier(jakarta.inject.Qualifier)

Aggregations

BeanDefinitionReference (io.micronaut.inject.BeanDefinitionReference)9 ArrayList (java.util.ArrayList)7 HashSet (java.util.HashSet)7 AnnotationMetadata (io.micronaut.core.annotation.AnnotationMetadata)6 NonNull (io.micronaut.core.annotation.NonNull)5 BeanContextException (io.micronaut.context.exceptions.BeanContextException)4 BeanDefinition (io.micronaut.inject.BeanDefinition)4 SoftServiceLoader (io.micronaut.core.io.service.SoftServiceLoader)3 AdvisedBeanType (io.micronaut.inject.AdvisedBeanType)3 BeanConfiguration (io.micronaut.inject.BeanConfiguration)3 ExecutableMethod (io.micronaut.inject.ExecutableMethod)3 Qualifiers (io.micronaut.inject.qualifiers.Qualifiers)3 Annotation (java.lang.annotation.Annotation)3 Method (java.lang.reflect.Method)3 Collection (java.util.Collection)3 Comparator (java.util.Comparator)3 HashMap (java.util.HashMap)3 Iterator (java.util.Iterator)3 List (java.util.List)3 Map (java.util.Map)3