Interface BeforeBeanDiscovery
-
public interface BeforeBeanDiscoveryThis event type is thrown by the container before the bean discovery process begins. If any observer method of the
BeforeBeanDiscoveryevent throws an exception, the exception is treated as a definition error by the container.- Author:
- Pete Muir, David Allen
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddAnnotatedType(AnnotatedType<?> type)Adds a givenAnnotatedTypeto the set of types which will be scanned during bean discovery.voidaddAnnotatedType(AnnotatedType<?> type, java.lang.String id)Adds a givenAnnotatedTypeto the set of types which will be scanned during bean discovery.voidaddInterceptorBinding(java.lang.Class<? extends java.lang.annotation.Annotation> bindingType, java.lang.annotation.Annotation... bindingTypeDef)Declares an annotation type as an interceptor binding type, and specifies its meta-annotations.voidaddInterceptorBinding(AnnotatedType<? extends java.lang.annotation.Annotation> bindingType)Declares an annotation type as an interceptor binding type.voidaddQualifier(java.lang.Class<? extends java.lang.annotation.Annotation> qualifier)Declares an annotation type as a Qualifier qualifier type.voidaddQualifier(AnnotatedType<? extends java.lang.annotation.Annotation> qualifier)Declares an annotation type as a Qualifier qualifier type.voidaddScope(java.lang.Class<? extends java.lang.annotation.Annotation> scopeType, boolean normal, boolean passivating)Declares an annotation type as a scope type.voidaddStereotype(java.lang.Class<? extends java.lang.annotation.Annotation> stereotype, java.lang.annotation.Annotation... stereotypeDef)Declares an annotation type as a stereotype, and specifies its meta-annotations.
-
-
-
Method Detail
-
addQualifier
void addQualifier(java.lang.Class<? extends java.lang.annotation.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
Qualifierto it.- Parameters:
qualifier- The annotation to treat as a qualifier- Throws:
java.lang.IllegalStateException- if called outside of the observer method invocation
-
addQualifier
void addQualifier(AnnotatedType<? extends java.lang.annotation.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
Qualifierto it.- Parameters:
qualifier- The annotation to treat as a qualifier- Throws:
java.lang.IllegalStateException- if called outside of the observer method invocation- Since:
- 1.1
-
addScope
void addScope(java.lang.Class<? extends java.lang.annotation.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
NormalScopeorScopeannotations to it. You can also use this method to override an existing normal scope definition.- Parameters:
scopeType- The annotation type to treat as a scope typenormal- Indicates if the scope is normalpassivating- Indicates if the scope is passivation capable- Throws:
java.lang.IllegalStateException- if called outside of the observer method invocation- See Also:
AfterBeanDiscovery.addContext(javax.enterprise.context.spi.Context)
-
addStereotype
void addStereotype(java.lang.Class<? extends java.lang.annotation.Annotation> stereotype, java.lang.annotation.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
Stereotypeto it. You can also use this method to override an existing stereotype definition.- Parameters:
stereotype- The annotation type to treat as a stereotypestereotypeDef- An optional list of annotations defining the stereotype- Throws:
java.lang.IllegalStateException- if called outside of the observer method invocation
-
addInterceptorBinding
void addInterceptorBinding(AnnotatedType<? extends java.lang.annotation.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
InterceptorBindingto it.- Parameters:
bindingType- The annotation type to treat as an interceptor binding type- Throws:
java.lang.IllegalStateException- if called outside of the observer method invocation
-
addInterceptorBinding
void addInterceptorBinding(java.lang.Class<? extends java.lang.annotation.Annotation> bindingType, java.lang.annotation.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
InterceptorBindingto it.- Parameters:
bindingType- The annotation type to treat as an interceptor binding typebindingTypeDef- An optional list of annotations defining the interceptor- Throws:
java.lang.IllegalStateException- if called outside of the observer method invocation- Since:
- 1.1
-
addAnnotatedType
void addAnnotatedType(AnnotatedType<?> type)
Adds a given
AnnotatedTypeto 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.- Parameters:
type- TheAnnotatedTypeto add for later scanning- Throws:
java.lang.IllegalStateException- if called outside of the observer method invocation
-
addAnnotatedType
void addAnnotatedType(AnnotatedType<?> type, java.lang.String id)
Adds a given
AnnotatedTypeto the set of types which will be scanned during bean discovery.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 ofAnnotatedType.getJavaClass()to identify the type.AfterBeanDiscovery.getAnnotatedType(Class, String)andAfterBeanDiscovery.getAnnotatedTypes(Class)allows annotated types to be obtained by identifier.- Parameters:
type- TheAnnotatedTypeto add for later scanningid- The id of the annotated type- Throws:
java.lang.IllegalStateException- if called outside of the observer method invocation- Since:
- 1.1
-
-