Top Description Methods
javax.enterprise.inject.spi

public Interface AfterTypeDiscovery

Imports
javax.enterprise.inject.spi.configurator.AnnotatedTypeConfigurator, java.util.List

This event type is thrown by the container after type discovery is complete. If any observer method of the AfterTypeDiscovery event throws an exception, the exception is treated as a definition error by the container.

Any observer of this event is permitted to add classes to, or remove classes from, the list of alternatives, list of interceptors or list of decorators. The container will use the final values of these lists, after all observers have been called, to determine the enabled alternatives, interceptors, and decorators for application. Changes made to these lists after the invocation of the last observer method of the AfterTypeDiscovery are ignored.

Authors
Pete Muir, Antoine Sabot-Durand
Since
1.1

Method Summary

Modifier and TypeMethod and Description
public void
addAnnotatedType(AnnotatedType<?>
The javax.enterprise.inject.spi.AnnotatedType to add for later scanning
type
,
String
the identifier used to distinguish this AnnotatedType from an other one based on the same underlying type
id
)

Adds a given javax.enterprise.inject.spi.AnnotatedType to the set of types which will be scanned during bean discovery.

public <T> AnnotatedTypeConfigurator<T>

Returns:

a non reusable AnnotatedTypeConfigurator to configure the new AnnotatedType
addAnnotatedType
(Class<T>
class used to initialized the type and annotations on the AnnotatedTypeConfigurator
type
,
String
the identifier used to distinguish this AnnotatedType from an other one based on the same underlying type
id
)

Obtains a new AnnotatedTypeConfigurator to configure a new javax.enterprise.inject.spi.AnnotatedType and add it to the set of types which will be scanned during bean discovery at the end of the observer invocation.

public List<Class<?>>

Returns:

the list of enabled alternatives for the application, sorted by priority in ascending order. Alternatives enabled for a bean archive are not included.
getAlternatives
()

public List<Class<?>>

Returns:

the list of enabled decorators for the application, sorted by priority in ascending order. Decorators enabled for a bean archive are not included.
getDecorators
()

public List<Class<?>>

Returns:

the list of enabled interceptors for the application, sorted by priority in ascending order. Interceptors enabled for a bean archive are not included.
getInterceptors
()

Method Detail

addAnnotatedTypeback to summary
public void addAnnotatedType(AnnotatedType<?> type, String id)

Adds a given javax.enterprise.inject.spi.AnnotatedType to the set of types which will be scanned during bean discovery.

Thanks to the id parameter, this method allows multiple annotated types, based on the same underlying type, to be defined. AnnotatedTypes discovered by the container use the fully qualified class name of AnnotatedType#getJavaClass() to identify the type.

AfterBeanDiscovery#getAnnotatedType(Class, String) and AfterBeanDiscovery#getAnnotatedTypes(Class) allows annotated types to be obtained by identifier.

Parameters
type:AnnotatedType<?>

The javax.enterprise.inject.spi.AnnotatedType to add for later scanning

id:String

the identifier used to distinguish this AnnotatedType from an other one based on the same underlying type

Exceptions
IllegalStateException:
if called outside of the observer method invocation
addAnnotatedTypeback to summary
public <T> AnnotatedTypeConfigurator<T> addAnnotatedType(Class<T> type, String id)

Obtains a new AnnotatedTypeConfigurator to configure a new javax.enterprise.inject.spi.AnnotatedType and add it to the set of types which will be scanned during bean discovery at the end of the observer invocation. Calling this method multiple times will return a new AnnotatedTypeConfigurator.

Thanks to the id parameter, this method allows multiple annotated types, based on the same underlying type, to be defined. AnnotatedTypes discovered by the container use the fully qualified class name of AnnotatedType#getJavaClass() to identify the type.

AfterBeanDiscovery#getAnnotatedType(Class, String) and AfterBeanDiscovery#getAnnotatedTypes(Class) allows annotated types to be obtained by identifier.

Each call returns a new AnnotatedTypeConfigurator.
Parameters
type:Class<T>

class used to initialized the type and annotations on the AnnotatedTypeConfigurator

id:String

the identifier used to distinguish this AnnotatedType from an other one based on the same underlying type

Returns:AnnotatedTypeConfigurator<T>

a non reusable AnnotatedTypeConfigurator to configure the new AnnotatedType

Exceptions
IllegalStateException:
if called outside of the observer method invocation
Since
2.0
getAlternativesback to summary
public List<Class<?>> getAlternatives()
Returns:List<Class<?>>

the list of enabled alternatives for the application, sorted by priority in ascending order. Alternatives enabled for a bean archive are not included.

Exceptions
IllegalStateException:
if called outside of the observer method invocation
getDecoratorsback to summary
public List<Class<?>> getDecorators()
Returns:List<Class<?>>

the list of enabled decorators for the application, sorted by priority in ascending order. Decorators enabled for a bean archive are not included.

Exceptions
IllegalStateException:
if called outside of the observer method invocation
getInterceptorsback to summary
public List<Class<?>> getInterceptors()
Returns:List<Class<?>>

the list of enabled interceptors for the application, sorted by priority in ascending order. Interceptors enabled for a bean archive are not included.

Exceptions
IllegalStateException:
if called outside of the observer method invocation