Search in sources :

Example 1 with AfterBeanDiscovery

use of jakarta.enterprise.inject.spi.AfterBeanDiscovery in project core by weld.

the class ContainerLifecyleObserverTest method testExtensionBuilder.

@SuppressWarnings({ "serial" })
@Test
public void testExtensionBuilder() {
    ActionSequence.reset();
    Extension myExtension = ContainerLifecycleObserver.extensionBuilder().add(beforeBeanDiscovery((e) -> addAction(BeforeBeanDiscovery.class.getSimpleName()))).add(afterTypeDiscovery().notify((e, b) -> {
        addAction(AfterTypeDiscovery.class.getSimpleName());
        e.addAnnotatedType(b.createAnnotatedType(Charlie.class), Charlie.class.getName());
    })).add(afterBeanDiscovery((e) -> {
        addAction(AfterBeanDiscovery.class.getSimpleName());
        e.addObserverMethod().beanClass(Foo.class).observedType(Foo.class).notifyWith((ctx) -> {
        });
        e.addBean().beanClass(Integer.class).addType(Integer.class).addQualifier(Juicy.Literal.INSTANCE).createWith((ctx) -> Integer.valueOf(10));
    })).add(afterDeploymentValidation((e) -> addAction(AfterDeploymentValidation.class.getSimpleName()))).add(beforeShutdown((e) -> addAction(BeforeShutdown.class.getSimpleName()))).build();
    Extension myExtension2 = ContainerLifecycleObserver.extensionBuilder().add(processAnnotatedType().withAnnotations(RequestScoped.class).notify((e) -> e.veto())).add(processBeanAttributes().notify((e) -> addAction(ProcessBeanAttributes.class.getSimpleName()))).add(processSyntheticAnnotatedType(new TypeLiteral<ProcessSyntheticAnnotatedType<?>>() {
    }.getType()).notify((e) -> addAction(ProcessSyntheticAnnotatedType.class.getSimpleName()))).add(processInjectionPoint().notify((e) -> addAction(ProcessInjectionPoint.class.getSimpleName()))).add(processProducer().notify((e) -> addAction(ProcessProducer.class.getSimpleName()))).add(processBean().notify((e) -> addAction(ProcessBean.class.getSimpleName()))).add(processManagedBean().notify((e) -> addAction(ProcessManagedBean.class.getSimpleName()))).add(processProducerField().notify((e) -> addAction(ProcessProducerField.class.getSimpleName()))).add(processProducerMethod().notify((e) -> {
        // Weld SE defines some producer methods, e.g. ParametersFactory
        addAction(ProcessProducerMethod.class.getSimpleName());
    })).add(processBeanAttributes().notify((e) -> addAction(ProcessBeanAttributes.class.getSimpleName()))).add(processObserverMethod().notify((e) -> addAction(ProcessObserverMethod.class.getSimpleName()))).add(processObserverMethod(new TypeLiteral<ProcessObserverMethod<String, ?>>() {
    }.getType()).notify((e) -> addAction(ProcessObserverMethod.class.getSimpleName() + String.class.getSimpleName()))).add(processSyntheticObserverMethod(new TypeLiteral<ProcessSyntheticObserverMethod<Foo, ?>>() {
    }.getType()).notify((e) -> addAction(ProcessSyntheticObserverMethod.class.getSimpleName() + Foo.class.getSimpleName()))).add(processSyntheticBean(new TypeLiteral<ProcessSyntheticBean<Integer>>() {
    }.getType()).notify((e) -> addAction(ProcessSyntheticBean.class.getSimpleName() + Integer.class.getSimpleName()))).build();
    try (WeldContainer container = new Weld().disableDiscovery().beanClasses(Foo.class, Bravo.class).addExtension(myExtension).addExtension(myExtension2).initialize()) {
        assertTrue(container.select(Foo.class).isUnsatisfied());
        assertFalse(container.select(Bravo.class).isUnsatisfied());
        Assert.assertEquals(Integer.valueOf(10), container.select(Integer.class, Juicy.Literal.INSTANCE).get());
    }
    ActionSequence.assertSequenceDataContainsAll(BeforeBeanDiscovery.class, AfterTypeDiscovery.class, AfterBeanDiscovery.class, AfterDeploymentValidation.class, BeforeShutdown.class);
    ActionSequence.assertSequenceDataContainsAll(ProcessBeanAttributes.class, ProcessSyntheticAnnotatedType.class, ProcessInjectionPoint.class, ProcessObserverMethod.class, ProcessBeanAttributes.class, ProcessProducer.class);
    ActionSequence.assertSequenceDataContainsAll(ProcessObserverMethod.class.getSimpleName() + String.class.getSimpleName(), ProcessSyntheticObserverMethod.class.getSimpleName() + Foo.class.getSimpleName(), ProcessSyntheticBean.class.getSimpleName() + Integer.class.getSimpleName());
    ActionSequence.assertSequenceDataContainsAll(ProcessBean.class, ProcessManagedBean.class, ProcessProducerMethod.class, ProcessProducerField.class);
}
Also used : ContainerLifecycleObserver.processObserverMethod(org.jboss.weld.environment.se.ContainerLifecycleObserver.processObserverMethod) ContainerLifecycleObserver.processSyntheticBean(org.jboss.weld.environment.se.ContainerLifecycleObserver.processSyntheticBean) ContainerLifecycleObserver.beforeBeanDiscovery(org.jboss.weld.environment.se.ContainerLifecycleObserver.beforeBeanDiscovery) ProcessObserverMethod(jakarta.enterprise.inject.spi.ProcessObserverMethod) ContainerLifecycleObserver.afterBeanDiscovery(org.jboss.weld.environment.se.ContainerLifecycleObserver.afterBeanDiscovery) ProcessSyntheticObserverMethod(jakarta.enterprise.inject.spi.ProcessSyntheticObserverMethod) ContainerLifecycleObserver.afterTypeDiscovery(org.jboss.weld.environment.se.ContainerLifecycleObserver.afterTypeDiscovery) AfterTypeDiscovery(jakarta.enterprise.inject.spi.AfterTypeDiscovery) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) AfterDeploymentValidation(jakarta.enterprise.inject.spi.AfterDeploymentValidation) ProcessInjectionPoint(jakarta.enterprise.inject.spi.ProcessInjectionPoint) ContainerLifecycleObserver.processProducer(org.jboss.weld.environment.se.ContainerLifecycleObserver.processProducer) ProcessManagedBean(jakarta.enterprise.inject.spi.ProcessManagedBean) ProcessSyntheticAnnotatedType(jakarta.enterprise.inject.spi.ProcessSyntheticAnnotatedType) ContainerLifecycleObserver.processBean(org.jboss.weld.environment.se.ContainerLifecycleObserver.processBean) ContainerLifecycleObserver.beforeShutdown(org.jboss.weld.environment.se.ContainerLifecycleObserver.beforeShutdown) ProcessBeanAttributes(jakarta.enterprise.inject.spi.ProcessBeanAttributes) TypeLiteral(jakarta.enterprise.util.TypeLiteral) ProcessBean(jakarta.enterprise.inject.spi.ProcessBean) ProcessProducerMethod(jakarta.enterprise.inject.spi.ProcessProducerMethod) Extension(jakarta.enterprise.inject.spi.Extension) ProcessAnnotatedType(jakarta.enterprise.inject.spi.ProcessAnnotatedType) BeforeBeanDiscovery(jakarta.enterprise.inject.spi.BeforeBeanDiscovery) ActionSequence(org.jboss.weld.test.util.ActionSequence) ContainerLifecycleObserver.processInjectionPoint(org.jboss.weld.environment.se.ContainerLifecycleObserver.processInjectionPoint) ContainerLifecycleObserver.processSyntheticAnnotatedType(org.jboss.weld.environment.se.ContainerLifecycleObserver.processSyntheticAnnotatedType) ContainerLifecycleObserver.processProducerField(org.jboss.weld.environment.se.ContainerLifecycleObserver.processProducerField) Weld(org.jboss.weld.environment.se.Weld) ContainerLifecycleObserver.processSyntheticObserverMethod(org.jboss.weld.environment.se.ContainerLifecycleObserver.processSyntheticObserverMethod) BeforeShutdown(jakarta.enterprise.inject.spi.BeforeShutdown) Assert.assertTrue(org.junit.Assert.assertTrue) Test(org.junit.Test) ContainerLifecycleObserver.processManagedBean(org.jboss.weld.environment.se.ContainerLifecycleObserver.processManagedBean) WeldContainer(org.jboss.weld.environment.se.WeldContainer) ProcessSyntheticBean(jakarta.enterprise.inject.spi.ProcessSyntheticBean) ContainerLifecycleObserver.afterDeploymentValidation(org.jboss.weld.environment.se.ContainerLifecycleObserver.afterDeploymentValidation) ContainerLifecycleObserver.processProducerMethod(org.jboss.weld.environment.se.ContainerLifecycleObserver.processProducerMethod) AfterBeanDiscovery(jakarta.enterprise.inject.spi.AfterBeanDiscovery) ContainerLifecycleObserver(org.jboss.weld.environment.se.ContainerLifecycleObserver) Assert.assertFalse(org.junit.Assert.assertFalse) ActionSequence.addAction(org.jboss.weld.test.util.ActionSequence.addAction) ProcessProducerField(jakarta.enterprise.inject.spi.ProcessProducerField) ContainerLifecycleObserver.processAnnotatedType(org.jboss.weld.environment.se.ContainerLifecycleObserver.processAnnotatedType) ProcessProducer(jakarta.enterprise.inject.spi.ProcessProducer) Assert(org.junit.Assert) ContainerLifecycleObserver.processBeanAttributes(org.jboss.weld.environment.se.ContainerLifecycleObserver.processBeanAttributes) RequestScoped(jakarta.enterprise.context.RequestScoped) WeldContainer(org.jboss.weld.environment.se.WeldContainer) AfterDeploymentValidation(jakarta.enterprise.inject.spi.AfterDeploymentValidation) ProcessObserverMethod(jakarta.enterprise.inject.spi.ProcessObserverMethod) ProcessSyntheticAnnotatedType(jakarta.enterprise.inject.spi.ProcessSyntheticAnnotatedType) Weld(org.jboss.weld.environment.se.Weld) Extension(jakarta.enterprise.inject.spi.Extension) ProcessManagedBean(jakarta.enterprise.inject.spi.ProcessManagedBean) ProcessSyntheticBean(jakarta.enterprise.inject.spi.ProcessSyntheticBean) TypeLiteral(jakarta.enterprise.util.TypeLiteral) ProcessProducer(jakarta.enterprise.inject.spi.ProcessProducer) AfterBeanDiscovery(jakarta.enterprise.inject.spi.AfterBeanDiscovery) Test(org.junit.Test)

Example 2 with AfterBeanDiscovery

use of jakarta.enterprise.inject.spi.AfterBeanDiscovery in project core by weld.

the class ContainerLifecycleEventInvocationOutsideObserverTest method testAfterBeanDiscovery.

@Test
public void testAfterBeanDiscovery() {
    final AfterBeanDiscovery event = extension.getAfterBeanDiscovery();
    new Invocation() {

        void execute() {
            event.addBean(new DummyBean());
        }
    }.run();
    new Invocation() {

        void execute() {
            event.addContext(new DummyContext());
        }
    }.run();
    new Invocation() {

        void execute() {
            event.addObserverMethod(new DummyObserverMethod());
        }
    }.run();
    new Invocation() {

        void execute() {
            event.getAnnotatedType(ContainerLifecycleEventInvocationOutsideObserverTest.class, "foo");
        }
    }.run();
    new Invocation() {

        void execute() {
            event.getAnnotatedTypes(ContainerLifecycleEventInvocationOutsideObserverTest.class);
        }
    }.run();
}
Also used : AfterBeanDiscovery(jakarta.enterprise.inject.spi.AfterBeanDiscovery) Test(org.junit.Test)

Example 3 with AfterBeanDiscovery

use of jakarta.enterprise.inject.spi.AfterBeanDiscovery 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)

Example 4 with AfterBeanDiscovery

use of jakarta.enterprise.inject.spi.AfterBeanDiscovery in project helidon by oracle.

the class JedisExtension method addBeans.

private void addBeans(@Observes final AfterBeanDiscovery event, final BeanManager beanManager) throws IntrospectionException {
    if (event != null && beanManager != null) {
        for (final String instanceName : this.instanceNames) {
            if (instanceName != null) {
                final Set<Annotation> qualifiers;
                if (instanceName.equals("default")) {
                    qualifiers = Collections.singleton(Default.Literal.INSTANCE);
                } else {
                    qualifiers = Collections.singleton(NamedLiteral.of(instanceName));
                }
                event.<JedisPoolConfig>addBean().addTransitiveTypeClosure(JedisPoolConfig.class).scope(ApplicationScoped.class).addQualifiers(qualifiers).produceWith((instance) -> {
                    final JedisPoolConfig returnValue = new JedisPoolConfig();
                    try {
                        this.configure(instance.select(Config.class).get(), returnValue, JedisPoolConfig.class, instanceName);
                    } catch (final IntrospectionException | ReflectiveOperationException e) {
                        throw new CreationException(e.getMessage(), e);
                    }
                    return returnValue;
                });
                final Annotation[] qualifiersArray = qualifiers.toArray(new Annotation[qualifiers.size()]);
                event.<JedisPool>addBean().addTransitiveTypeClosure(JedisPool.class).scope(ApplicationScoped.class).addQualifiers(qualifiers).produceWith(instance -> {
                    return produceJedisPool(instance, instanceName, qualifiersArray);
                }).disposeWith((p, instance) -> p.destroy());
                event.<Jedis>addBean().addTransitiveTypeClosure(Jedis.class).scope(Dependent.class).addQualifiers(qualifiers).produceWith(instance -> instance.select(JedisPool.class, qualifiersArray).get().getResource()).disposeWith((j, instance) -> j.close());
            }
        }
    }
}
Also used : Dependent(jakarta.enterprise.context.Dependent) Observes(jakarta.enterprise.event.Observes) SSLParameters(javax.net.ssl.SSLParameters) ApplicationScoped(jakarta.enterprise.context.ApplicationScoped) HashMap(java.util.HashMap) ProcessInjectionPoint(jakarta.enterprise.inject.spi.ProcessInjectionPoint) Instance(jakarta.enterprise.inject.Instance) Default(jakarta.enterprise.inject.Default) HashSet(java.util.HashSet) LinkedHashMap(java.util.LinkedHashMap) Introspector(java.beans.Introspector) BeanInfo(java.beans.BeanInfo) Map(java.util.Map) JedisPool(redis.clients.jedis.JedisPool) HostnameVerifier(javax.net.ssl.HostnameVerifier) Method(java.lang.reflect.Method) BeanManager(jakarta.enterprise.inject.spi.BeanManager) CreationException(jakarta.enterprise.inject.CreationException) InjectionPoint(jakarta.enterprise.inject.spi.InjectionPoint) NamedLiteral(jakarta.enterprise.inject.literal.NamedLiteral) Set(java.util.Set) Config(org.eclipse.microprofile.config.Config) IntrospectionException(java.beans.IntrospectionException) SSLSocketFactory(javax.net.ssl.SSLSocketFactory) Objects(java.util.Objects) Protocol(redis.clients.jedis.Protocol) ParameterizedType(java.lang.reflect.ParameterizedType) AfterBeanDiscovery(jakarta.enterprise.inject.spi.AfterBeanDiscovery) Type(java.lang.reflect.Type) Provider(jakarta.inject.Provider) Jedis(redis.clients.jedis.Jedis) PropertyDescriptor(java.beans.PropertyDescriptor) Annotation(java.lang.annotation.Annotation) Optional(java.util.Optional) JedisPoolConfig(redis.clients.jedis.JedisPoolConfig) Collections(java.util.Collections) Named(jakarta.inject.Named) IntrospectionException(java.beans.IntrospectionException) CreationException(jakarta.enterprise.inject.CreationException) Dependent(jakarta.enterprise.context.Dependent) ApplicationScoped(jakarta.enterprise.context.ApplicationScoped) JedisPoolConfig(redis.clients.jedis.JedisPoolConfig) Annotation(java.lang.annotation.Annotation)

Example 5 with AfterBeanDiscovery

use of jakarta.enterprise.inject.spi.AfterBeanDiscovery in project core by weld.

the class ContainerLifecyleObserverTest method testAddContainerLifecycleObserver.

@SuppressWarnings("serial")
@Test
public void testAddContainerLifecycleObserver() {
    final AtomicBoolean called = new AtomicBoolean(false);
    try (WeldContainer container = new Weld().disableDiscovery().beanClasses(Foo.class).addContainerLifecycleObserver(processAnnotatedType(new TypeLiteral<ProcessAnnotatedType<Foo>>() {
    }.getType()).notify((e) -> e.veto())).addContainerLifecycleObserver(afterBeanDiscovery((e) -> called.set(true))).initialize()) {
        assertTrue(called.get());
        assertTrue(container.select(Foo.class).isUnsatisfied());
    }
}
Also used : ContainerLifecycleObserver.processObserverMethod(org.jboss.weld.environment.se.ContainerLifecycleObserver.processObserverMethod) ContainerLifecycleObserver.processSyntheticBean(org.jboss.weld.environment.se.ContainerLifecycleObserver.processSyntheticBean) ContainerLifecycleObserver.beforeBeanDiscovery(org.jboss.weld.environment.se.ContainerLifecycleObserver.beforeBeanDiscovery) ProcessObserverMethod(jakarta.enterprise.inject.spi.ProcessObserverMethod) ContainerLifecycleObserver.afterBeanDiscovery(org.jboss.weld.environment.se.ContainerLifecycleObserver.afterBeanDiscovery) ProcessSyntheticObserverMethod(jakarta.enterprise.inject.spi.ProcessSyntheticObserverMethod) ContainerLifecycleObserver.afterTypeDiscovery(org.jboss.weld.environment.se.ContainerLifecycleObserver.afterTypeDiscovery) AfterTypeDiscovery(jakarta.enterprise.inject.spi.AfterTypeDiscovery) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) AfterDeploymentValidation(jakarta.enterprise.inject.spi.AfterDeploymentValidation) ProcessInjectionPoint(jakarta.enterprise.inject.spi.ProcessInjectionPoint) ContainerLifecycleObserver.processProducer(org.jboss.weld.environment.se.ContainerLifecycleObserver.processProducer) ProcessManagedBean(jakarta.enterprise.inject.spi.ProcessManagedBean) ProcessSyntheticAnnotatedType(jakarta.enterprise.inject.spi.ProcessSyntheticAnnotatedType) ContainerLifecycleObserver.processBean(org.jboss.weld.environment.se.ContainerLifecycleObserver.processBean) ContainerLifecycleObserver.beforeShutdown(org.jboss.weld.environment.se.ContainerLifecycleObserver.beforeShutdown) ProcessBeanAttributes(jakarta.enterprise.inject.spi.ProcessBeanAttributes) TypeLiteral(jakarta.enterprise.util.TypeLiteral) ProcessBean(jakarta.enterprise.inject.spi.ProcessBean) ProcessProducerMethod(jakarta.enterprise.inject.spi.ProcessProducerMethod) Extension(jakarta.enterprise.inject.spi.Extension) ProcessAnnotatedType(jakarta.enterprise.inject.spi.ProcessAnnotatedType) BeforeBeanDiscovery(jakarta.enterprise.inject.spi.BeforeBeanDiscovery) ActionSequence(org.jboss.weld.test.util.ActionSequence) ContainerLifecycleObserver.processInjectionPoint(org.jboss.weld.environment.se.ContainerLifecycleObserver.processInjectionPoint) ContainerLifecycleObserver.processSyntheticAnnotatedType(org.jboss.weld.environment.se.ContainerLifecycleObserver.processSyntheticAnnotatedType) ContainerLifecycleObserver.processProducerField(org.jboss.weld.environment.se.ContainerLifecycleObserver.processProducerField) Weld(org.jboss.weld.environment.se.Weld) ContainerLifecycleObserver.processSyntheticObserverMethod(org.jboss.weld.environment.se.ContainerLifecycleObserver.processSyntheticObserverMethod) BeforeShutdown(jakarta.enterprise.inject.spi.BeforeShutdown) Assert.assertTrue(org.junit.Assert.assertTrue) Test(org.junit.Test) ContainerLifecycleObserver.processManagedBean(org.jboss.weld.environment.se.ContainerLifecycleObserver.processManagedBean) WeldContainer(org.jboss.weld.environment.se.WeldContainer) ProcessSyntheticBean(jakarta.enterprise.inject.spi.ProcessSyntheticBean) ContainerLifecycleObserver.afterDeploymentValidation(org.jboss.weld.environment.se.ContainerLifecycleObserver.afterDeploymentValidation) ContainerLifecycleObserver.processProducerMethod(org.jboss.weld.environment.se.ContainerLifecycleObserver.processProducerMethod) AfterBeanDiscovery(jakarta.enterprise.inject.spi.AfterBeanDiscovery) ContainerLifecycleObserver(org.jboss.weld.environment.se.ContainerLifecycleObserver) Assert.assertFalse(org.junit.Assert.assertFalse) ActionSequence.addAction(org.jboss.weld.test.util.ActionSequence.addAction) ProcessProducerField(jakarta.enterprise.inject.spi.ProcessProducerField) ContainerLifecycleObserver.processAnnotatedType(org.jboss.weld.environment.se.ContainerLifecycleObserver.processAnnotatedType) ProcessProducer(jakarta.enterprise.inject.spi.ProcessProducer) Assert(org.junit.Assert) ContainerLifecycleObserver.processBeanAttributes(org.jboss.weld.environment.se.ContainerLifecycleObserver.processBeanAttributes) RequestScoped(jakarta.enterprise.context.RequestScoped) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) TypeLiteral(jakarta.enterprise.util.TypeLiteral) WeldContainer(org.jboss.weld.environment.se.WeldContainer) Weld(org.jboss.weld.environment.se.Weld) Test(org.junit.Test)

Aggregations

AfterBeanDiscovery (jakarta.enterprise.inject.spi.AfterBeanDiscovery)8 Extension (jakarta.enterprise.inject.spi.Extension)6 Observes (jakarta.enterprise.event.Observes)5 ProcessInjectionPoint (jakarta.enterprise.inject.spi.ProcessInjectionPoint)5 Set (java.util.Set)5 ApplicationScoped (jakarta.enterprise.context.ApplicationScoped)4 ProcessAnnotatedType (jakarta.enterprise.inject.spi.ProcessAnnotatedType)4 Annotation (java.lang.annotation.Annotation)4 HashSet (java.util.HashSet)4 Dependent (jakarta.enterprise.context.Dependent)3 AfterDeploymentValidation (jakarta.enterprise.inject.spi.AfterDeploymentValidation)3 BeanManager (jakarta.enterprise.inject.spi.BeanManager)3 BeforeBeanDiscovery (jakarta.enterprise.inject.spi.BeforeBeanDiscovery)3 Priority (jakarta.annotation.Priority)2 RequestScoped (jakarta.enterprise.context.RequestScoped)2 AfterTypeDiscovery (jakarta.enterprise.inject.spi.AfterTypeDiscovery)2 Annotated (jakarta.enterprise.inject.spi.Annotated)2 AnnotatedMethod (jakarta.enterprise.inject.spi.AnnotatedMethod)2 AnnotatedType (jakarta.enterprise.inject.spi.AnnotatedType)2 InjectionPoint (jakarta.enterprise.inject.spi.InjectionPoint)2