Package org.jboss.weld.bootstrap.events
Class AfterBeanDiscoveryImpl
- java.lang.Object
-
- org.jboss.weld.bootstrap.events.ContainerEvent
-
- org.jboss.weld.bootstrap.events.AbstractContainerEvent
-
- org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent
-
- org.jboss.weld.bootstrap.events.AbstractBeanDiscoveryEvent
-
- org.jboss.weld.bootstrap.events.AfterBeanDiscoveryImpl
-
- All Implemented Interfaces:
AfterBeanDiscovery
,WeldAfterBeanDiscovery
,NotificationListener
public class AfterBeanDiscoveryImpl extends AbstractBeanDiscoveryEvent implements WeldAfterBeanDiscovery
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> WeldBeanConfigurator<T>
addBean()
Obtain aWeldBeanConfigurator
, an extended version ofBeanConfigurator
.void
addBean(Bean<?> bean)
Fires an event of typeProcessBean
containing the givenBean
and then registers theBean
with the container, thereby making a bean which is not an interceptor nor a decorator available for injection into other beans.<T> WeldBeanConfigurator<T>
addBean(Class<?> receiverClass)
Used byLiteExtensionTranslator
to register beans coming from Build Compatible extensions.void
addContext(Context context)
Registers a customContext
object with the container.InterceptorConfigurator
addInterceptor()
Obtain aInterceptorConfigurator
to configure a newInterceptor
.<T> ObserverMethodConfigurator<T>
addObserverMethod()
obtains a newObserverMethodConfigurator
to configure a newObserverMethod
and add it at the end of the observer invocation.void
addObserverMethod(ObserverMethod<?> observerMethod)
Fires an event of typeProcessObserverMethod
containing the givenObserverMethod
and then registers theObserverMethod
with the container, thereby making it available for event notifications.static void
fire(BeanManagerImpl beanManager, org.jboss.weld.bootstrap.spi.Deployment deployment, BeanDeploymentArchiveMapping bdaMapping, Collection<ContextHolder<? extends Context>> contexts)
<T> AnnotatedType<T>
getAnnotatedType(Class<T> type, String id)
Obtain theAnnotatedType
that may be used to read the annotations of the given class or interface as defined during container initialization.<T> Iterable<AnnotatedType<T>>
getAnnotatedTypes(Class<T> type)
Obtain theAnnotatedType
s that may be used to read the annotations of the given class or interface as defined during container initialization.-
Methods inherited from class org.jboss.weld.bootstrap.events.AbstractBeanDiscoveryEvent
getBeanDeployments, getContexts, getDeployment, getOrCreateBeanDeployment, getTypeStore
-
Methods inherited from class org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent
addDefinitionError, fire
-
Methods inherited from class org.jboss.weld.bootstrap.events.AbstractContainerEvent
getActualTypeArguments, getBeanManager, getErrors, getEventType, getRawType
-
Methods inherited from class org.jboss.weld.bootstrap.events.ContainerEvent
checkWithinObserverNotification, getReceiver, postNotify, preNotify
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jakarta.enterprise.inject.spi.AfterBeanDiscovery
addDefinitionError
-
-
-
-
Method Detail
-
fire
public static void fire(BeanManagerImpl beanManager, org.jboss.weld.bootstrap.spi.Deployment deployment, BeanDeploymentArchiveMapping bdaMapping, Collection<ContextHolder<? extends Context>> contexts)
-
addBean
public void addBean(Bean<?> bean)
Description copied from interface:AfterBeanDiscovery
Fires an event of typeProcessBean
containing the givenBean
and then registers theBean
with the container, thereby making a bean which is not an interceptor nor a decorator available for injection into other beans. The givenBean
may implementInterceptor
orDecorator
.- Specified by:
addBean
in interfaceAfterBeanDiscovery
- Parameters:
bean
- The bean to add to the deployment
-
addBean
public <T> WeldBeanConfigurator<T> addBean()
Description copied from interface:WeldAfterBeanDiscovery
Obtain aWeldBeanConfigurator
, an extended version ofBeanConfigurator
.The configurator behaves in the same manner as
BeanConfigurator
. Configured bean is added automatically at the end of the observer invocation.Each call returns new configurator instance.
- Specified by:
addBean
in interfaceAfterBeanDiscovery
- Specified by:
addBean
in interfaceWeldAfterBeanDiscovery
- Type Parameters:
T
- type of bean- Returns:
- a configurator to configure custom new bean
-
addBean
public <T> WeldBeanConfigurator<T> addBean(Class<?> receiverClass)
Used byLiteExtensionTranslator
to register beans coming from Build Compatible extensions. This ensures that the bean is registered under given BCE class instead of being linked toLiteExtensionTranslator
. This method should not be used anywhere else.- Type Parameters:
T
- bean type- Parameters:
receiverClass
- class of the Build Compatible extension performing synth. bean registration- Returns:
- instance of
WeldBeanConfigurator
-
addContext
public void addContext(Context context)
Description copied from interface:AfterBeanDiscovery
Registers a customContext
object with the container.- Specified by:
addContext
in interfaceAfterBeanDiscovery
- Parameters:
context
- The custom context to add to the deployment
-
addObserverMethod
public void addObserverMethod(ObserverMethod<?> observerMethod)
Description copied from interface:AfterBeanDiscovery
Fires an event of typeProcessObserverMethod
containing the givenObserverMethod
and then registers theObserverMethod
with the container, thereby making it available for event notifications.- Specified by:
addObserverMethod
in interfaceAfterBeanDiscovery
- Parameters:
observerMethod
- The custom observer method to add to the deployment
-
addObserverMethod
public <T> ObserverMethodConfigurator<T> addObserverMethod()
Description copied from interface:AfterBeanDiscovery
obtains a newObserverMethodConfigurator
to configure a newObserverMethod
and add it at the end of the observer invocation. It will then fire an event of typeProcessObserverMethod
containing the builtObserverMethod
from this configuration and then registers theObserverMethod
with the container, thereby making it available for event notifications. Each call returns a new ObserverMethodConfigurator.- Specified by:
addObserverMethod
in interfaceAfterBeanDiscovery
- Type Parameters:
T
- type of the event the configured ObserverMethod will observe- Returns:
- a non reusable
ObserverMethodConfigurator
instance
-
getAnnotatedType
public <T> AnnotatedType<T> getAnnotatedType(Class<T> type, String id)
Description copied from interface:AfterBeanDiscovery
Obtain theAnnotatedType
that may be used to read the annotations of the given class or interface as defined during container initialization.- Specified by:
getAnnotatedType
in interfaceAfterBeanDiscovery
- Type Parameters:
T
- the class or interface- Parameters:
type
- theClass
objectid
- the type identifier. If null, the fully qualifier class name of type is used- Returns:
- the
AnnotatedType
-
getAnnotatedTypes
public <T> Iterable<AnnotatedType<T>> getAnnotatedTypes(Class<T> type)
Description copied from interface:AfterBeanDiscovery
Obtain theAnnotatedType
s that may be used to read the annotations of the given class or interface as defined during container initialization.- Specified by:
getAnnotatedTypes
in interfaceAfterBeanDiscovery
- Type Parameters:
T
- the class or interface- Parameters:
type
- theClass
object- Returns:
- the
AnnotatedType
s
-
addInterceptor
public InterceptorConfigurator addInterceptor()
Description copied from interface:WeldAfterBeanDiscovery
Obtain aInterceptorConfigurator
to configure a newInterceptor
.The configured interceptor is automatically added at the end of the observer invocation.
Each call returns a new configurator instance.
- Specified by:
addInterceptor
in interfaceWeldAfterBeanDiscovery
- Returns:
- a configurator to configure a new interceptor
-
-