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.voidaddBean(Bean<?> bean)Fires an event of typeProcessBeancontaining the givenBeanand then registers theBeanwith the container, thereby making a bean which is not an interceptor nor a decorator available for injection into other beans.voidaddContext(Context context)Registers a customContextobject with the container.InterceptorConfiguratoraddInterceptor()Obtain aInterceptorConfiguratorto configure a newInterceptor.<T> ObserverMethodConfigurator<T>addObserverMethod()obtains a newObserverMethodConfiguratorto configure a newObserverMethodand add it at the end of the observer invocation.voidaddObserverMethod(ObserverMethod<?> observerMethod)Fires an event of typeProcessObserverMethodcontaining the givenObserverMethodand then registers theObserverMethodwith the container, thereby making it available for event notifications.static voidfire(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 theAnnotatedTypethat 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 theAnnotatedTypes 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 javax.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:AfterBeanDiscoveryFires an event of typeProcessBeancontaining the givenBeanand then registers theBeanwith the container, thereby making a bean which is not an interceptor nor a decorator available for injection into other beans. The givenBeanmay implementInterceptororDecorator.- Specified by:
addBeanin interfaceAfterBeanDiscovery- Parameters:
bean- The bean to add to the deployment
-
addBean
public <T> WeldBeanConfigurator<T> addBean()
Description copied from interface:WeldAfterBeanDiscoveryObtain 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:
addBeanin interfaceAfterBeanDiscovery- Specified by:
addBeanin interfaceWeldAfterBeanDiscovery- Returns:
- a configurator to configure custom new bean
-
addContext
public void addContext(Context context)
Description copied from interface:AfterBeanDiscoveryRegisters a customContextobject with the container.- Specified by:
addContextin interfaceAfterBeanDiscovery- Parameters:
context- The custom context to add to the deployment
-
addObserverMethod
public void addObserverMethod(ObserverMethod<?> observerMethod)
Description copied from interface:AfterBeanDiscoveryFires an event of typeProcessObserverMethodcontaining the givenObserverMethodand then registers theObserverMethodwith the container, thereby making it available for event notifications.- Specified by:
addObserverMethodin interfaceAfterBeanDiscovery- Parameters:
observerMethod- The custom observer method to add to the deployment
-
addObserverMethod
public <T> ObserverMethodConfigurator<T> addObserverMethod()
Description copied from interface:AfterBeanDiscoveryobtains a newObserverMethodConfiguratorto configure a newObserverMethodand add it at the end of the observer invocation. It will then fire an event of typeProcessObserverMethodcontaining the builtObserverMethodfrom this configuration and then registers theObserverMethodwith the container, thereby making it available for event notifications. Each call returns a new ObserverMethodConfigurator.- Specified by:
addObserverMethodin interfaceAfterBeanDiscovery- Returns:
- a non reusable
ObserverMethodConfiguratorinstance
-
getAnnotatedType
public <T> AnnotatedType<T> getAnnotatedType(Class<T> type, String id)
Description copied from interface:AfterBeanDiscoveryObtain theAnnotatedTypethat may be used to read the annotations of the given class or interface as defined during container initialization.- Specified by:
getAnnotatedTypein interfaceAfterBeanDiscovery- Type Parameters:
T- the class or interface- Parameters:
type- theClassobjectid- 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:AfterBeanDiscoveryObtain theAnnotatedTypes that may be used to read the annotations of the given class or interface as defined during container initialization.- Specified by:
getAnnotatedTypesin interfaceAfterBeanDiscovery- Type Parameters:
T- the class or interface- Parameters:
type- theClassobject- Returns:
- the
AnnotatedTypes
-
addInterceptor
public InterceptorConfigurator addInterceptor()
Description copied from interface:WeldAfterBeanDiscoveryObtain aInterceptorConfiguratorto 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:
addInterceptorin interfaceWeldAfterBeanDiscovery- Returns:
- a configurator to configure a new interceptor
-
-