public interface BeforeBeanDiscovery
This event type is thrown by the container before the bean discovery process begins. If any observer method of the
BeforeBeanDiscovery
event throws an exception, the exception is treated as a definition error by the container.
Modifier and Type | Method and Description |
---|---|
void |
addAnnotatedType(AnnotatedType<?> type)
Adds a given
AnnotatedType to the set of types which will be scanned during bean
discovery. |
void |
addAnnotatedType(AnnotatedType<?> type,
String id)
Adds a given
AnnotatedType to the set of types which will be scanned during bean
discovery. |
<T> AnnotatedTypeConfigurator<T> |
addAnnotatedType(Class<T> type,
String id)
Obtains a new
AnnotatedTypeConfigurator to configure a new AnnotatedType and
add it to the set of types which will be scanned during bean discovery at the end of the observer invocation |
void |
addInterceptorBinding(AnnotatedType<? extends Annotation> bindingType)
Declares an annotation type as an interceptor binding type.
|
void |
addInterceptorBinding(Class<? extends Annotation> bindingType,
Annotation... bindingTypeDef)
Declares an annotation type as an interceptor binding type, and specifies its meta-annotations.
|
void |
addQualifier(AnnotatedType<? extends Annotation> qualifier)
Declares an annotation type as a Qualifier qualifier type.
|
void |
addQualifier(Class<? extends Annotation> qualifier)
Declares an annotation type as a Qualifier qualifier type.
|
void |
addScope(Class<? extends Annotation> scopeType,
boolean normal,
boolean passivating)
Declares an annotation type as a scope type.
|
void |
addStereotype(Class<? extends Annotation> stereotype,
Annotation... stereotypeDef)
Declares an annotation type as a stereotype, and specifies its
meta-annotations.
|
<T extends Annotation> |
configureInterceptorBinding(Class<T> bindingType)
Obtains a new
AnnotatedTypeConfigurator to configure a new AnnotatedType
and declares it as an interceptor binding type. |
<T extends Annotation> |
configureQualifier(Class<T> qualifier)
Obtains a new
AnnotatedTypeConfigurator to configure a new AnnotatedType
and declares it as a Qualifier qualifier type. |
void addQualifier(Class<? extends Annotation> qualifier)
Declares an annotation type as a Qualifier qualifier type.
This is only required if you wish to make an annotation a qualifier without adding Qualifier
to it.
qualifier
- The annotation to treat as a qualifierIllegalStateException
- if called outside of the observer method invocationvoid addQualifier(AnnotatedType<? extends Annotation> qualifier)
Declares an annotation type as a Qualifier qualifier type.
This is only required if you wish to make an annotation a qualifier without adding Qualifier
to it.
qualifier
- The annotation to treat as a qualifierIllegalStateException
- if called outside of the observer method invocationvoid addScope(Class<? extends Annotation> scopeType, boolean normal, boolean passivating)
Declares an annotation type as a scope type.
This is only required if you wish to make an annotation a scope type without adding the NormalScope
or
Scope
annotations to it. You can also use this method to override an existing normal scope definition.
scopeType
- The annotation type to treat as a scope typenormal
- Indicates if the scope is normalpassivating
- Indicates if the scope is passivation
capableIllegalStateException
- if called outside of the observer method invocationAfterBeanDiscovery.addContext(Context)
void addStereotype(Class<? extends Annotation> stereotype, Annotation... stereotypeDef)
Declares an annotation type as a stereotype, and specifies its meta-annotations.
This is only required if you wish to make an annotation a stereotype without adding Stereotype
to it. You can
also use this method to override an existing stereotype definition.
stereotype
- The annotation type to treat as a stereotypestereotypeDef
- An optional list of annotations defining the stereotypeIllegalStateException
- if called outside of the observer method invocationvoid addInterceptorBinding(AnnotatedType<? extends Annotation> bindingType)
Declares an annotation type as an interceptor binding type.
This is only required if you wish to make an annotation an interceptor binding type without adding
InterceptorBinding
to it.
bindingType
- The annotation type to treat as an interceptor binding typeIllegalStateException
- if called outside of the observer method invocationvoid addInterceptorBinding(Class<? extends Annotation> bindingType, Annotation... bindingTypeDef)
Declares an annotation type as an interceptor binding type, and specifies its meta-annotations.
This is only required if you wish to make an annotation an interceptor binding type without adding
InterceptorBinding
to it.
bindingType
- The annotation type to treat as an interceptor binding typebindingTypeDef
- An optional list of annotations defining the interceptorIllegalStateException
- if called outside of the observer method invocationvoid addAnnotatedType(AnnotatedType<?> type)
Adds a given AnnotatedType
to the set of types which will be scanned during bean
discovery.
This method is deprecated from CDI 1.1 and addAnnotatedType(AnnotatedType, String)
should be used instead.
type
- The AnnotatedType
to add for later scanningIllegalStateException
- if called outside of the observer method invocationvoid addAnnotatedType(AnnotatedType<?> type, String id)
Adds a given 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. AnnotatedType
s
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.
type
- The AnnotatedType
to add for later scanningid
- the identifier used to distinguish this AnnotatedType from an other one based on the same underlying typeIllegalStateException
- if called outside of the observer method invocation<T> AnnotatedTypeConfigurator<T> addAnnotatedType(Class<T> type, String id)
Obtains a new AnnotatedTypeConfigurator
to configure a new AnnotatedType
and
add it to the set of types which will be scanned during bean discovery at the end of the observer invocation
Thanks to the id parameter, this method allows multiple annotated types, based on the same underlying type, to be defined with a builder.
AnnotatedType
s 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.
T
- class typetype
- class used to initialized the type and annotations on the AnnotatedTypeConfigurator
id
- the identifier used to distinguish this AnnotatedType from an other one based on the same underlying typeAnnotatedTypeConfigurator
to configure the new AnnotatedTypeIllegalStateException
- if called outside of the observer method invocation<T extends Annotation> AnnotatedTypeConfigurator<T> configureQualifier(Class<T> qualifier)
Obtains a new AnnotatedTypeConfigurator
to configure a new AnnotatedType
and declares it as a Qualifier qualifier type.
This is only required if you wish to make an annotation a qualifier without adding Qualifier
to it and need to
easily add other annotations (like Nonbinding
on its members.
T
- qualifier typequalifier
- The annotation class used to initialized the configuratorAnnotatedTypeConfigurator
to configure the qualifierIllegalStateException
- if called outside of the observer method invocation<T extends Annotation> AnnotatedTypeConfigurator<T> configureInterceptorBinding(Class<T> bindingType)
Obtains a new AnnotatedTypeConfigurator
to configure a new AnnotatedType
and declares it as an interceptor binding type.
This is only required if you wish to make an annotation an interceptor binding type without adding
InterceptorBinding
to it and need to easily add other annotations
(like Nonbinding
on its members.
T
- binding class typebindingType
- The annotation class used to initialized the configuratorAnnotatedTypeConfigurator
to configure the interceptor bindingIllegalStateException
- if called outside of the observer method invocationComments to: cdi-dev@eclipse.org.
Copyright © 2018,2020 Eclipse Foundation.
Use is subject to license terms.