Class BeanConfiguratorBase<THIS extends BeanConfiguratorBase<THIS,T>,T>
- All Implemented Interfaces:
Consumer<org.jboss.jandex.AnnotationInstance>
- Direct Known Subclasses:
BeanConfigurator
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Booleanprotected Consumer<io.quarkus.gizmo.MethodCreator>protected Consumer<io.quarkus.gizmo.MethodCreator>protected booleanprotected Consumer<io.quarkus.gizmo.MethodCreator>protected booleanprotected Stringprotected final org.jboss.jandex.DotNameprotected final Set<InjectionPointInfo.TypeAndQualifiers>protected io.quarkus.arc.processor.InterceptionProxyInfoprotected Stringprotected Integerprotected org.jboss.jandex.Typeprotected final Set<org.jboss.jandex.AnnotationInstance>protected final Set<org.jboss.jandex.Type>protected booleanprotected ScopeInfoprotected Integerprotected final List<StereotypeInfo>protected Stringprotected final Set<org.jboss.jandex.Type>protected final Set<org.jboss.jandex.Type>Fields inherited from class io.quarkus.arc.processor.ConfiguratorBase
params -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(org.jboss.jandex.AnnotationInstance qualifier) addInjectionPoint(org.jboss.jandex.Type requiredType, org.jboss.jandex.AnnotationInstance... requiredQualifiers) Adds a synthetic injection point.addQualifier(Class<? extends Annotation> annotationClass) addQualifier(org.jboss.jandex.AnnotationInstance qualifier) addQualifier(org.jboss.jandex.DotName annotationName) addStereotype(StereotypeInfo stereotype) addType(org.jboss.jandex.DotName className) addType(org.jboss.jandex.Type type) addTypeClosure(Class<?> type) Adds an unrestricted set of bean types for the given type as if it represented a bean class of a managed bean.addTypeClosure(org.jboss.jandex.DotName typeName) Adds an unrestricted set of bean types for the given type as if it represented a bean class of a managed bean.addTypeClosure(org.jboss.jandex.Type type) Adds an unrestricted set of bean types for the given type as if it represented a bean class of a managed bean.alternative(boolean alternative) protected static <T> TcheckActive(Class<? extends Supplier<ActiveResult>> checkActiveClazz) Configures the class of the "check active" procedure.checkActive(Consumer<io.quarkus.gizmo.MethodCreator> methodCreatorConsumer) Configures the procedure that generates the bytecode for checking whether this bean is active or not.creator(Class<? extends BeanCreator<U>> creatorClazz) The first method parameter is the synthetic creational context, i.e.destroyer(Class<? extends BeanDestroyer<U>> destroyerClazz) Forces the bean to be considered an 'application class', so it will be defined in the runtime ClassLoader and re-created on each redeployment.identifier(String identifier) The identifier becomes part of theBeanInfo.getIdentifier()andInjectableBean.getIdentifier().Declares that this synthetic bean has an injection point of typeInterceptionProxy<PT>, wherePTis the provider type of this bean.injectInterceptionProxy(Class<?> bindingsSource) Declares that this synthetic bean has an injection point of typeInterceptionProxy<PT>, wherePTis the provider type of this bean.injectInterceptionProxy(org.jboss.jandex.DotName bindingsSource) Declares that this synthetic bean has an injection point of typeInterceptionProxy<PT>, wherePTis the provider type of this bean.Unlike thename(String)method, a newNamedqualifier with the specified value is added to the configured bean.priority(int value) providerType(org.jboss.jandex.Type providerType) The provider type is the "real" type of the bean instance created viaInjectableReferenceProvider.get(CreationalContext).qualifiers(org.jboss.jandex.AnnotationInstance... qualifiers) read(BeanConfiguratorBase<?, ?> base) Read metadata from another configurator base.removeTypes(Class<?>... types) Removes listed types from the resulting types of the synthetic bean.removeTypes(org.jboss.jandex.DotName... types) Removes listed types from the resulting types of the synthetic bean.removeTypes(org.jboss.jandex.Type... types) Removes listed types from the resulting types of the synthetic bean.scope(Class<? extends Annotation> scope) startup()Initialize the bean eagerly at application startup.startup(int priority) Initialize the bean eagerly at application startup.stereotypes(StereotypeInfo... stereotypes) targetPackageName(String name) types(org.jboss.jandex.Type... types) Methods inherited from class io.quarkus.arc.processor.ConfiguratorBase
param, param, param, param, param, param, param, param, param, param, param, param, param, param, param, param, param, param, param, param, param, param, param, param, param, param, param, param, read, self
-
Field Details
-
identifier
-
implClazz
protected final org.jboss.jandex.DotName implClazz -
types
-
registeredTypeClosures
-
typesToRemove
-
qualifiers
-
scope
-
alternative
-
stereotypes
-
name
-
creatorConsumer
-
destroyerConsumer
-
defaultBean
protected boolean defaultBean -
removable
protected boolean removable -
providerType
protected org.jboss.jandex.Type providerType -
forceApplicationClass
protected boolean forceApplicationClass -
targetPackageName
-
priority
-
injectionPoints
-
startupPriority
-
interceptionProxy
protected io.quarkus.arc.processor.InterceptionProxyInfo interceptionProxy -
checkActiveConsumer
-
-
Constructor Details
-
BeanConfiguratorBase
protected BeanConfiguratorBase(org.jboss.jandex.DotName implClazz)
-
-
Method Details
-
read
Read metadata from another configurator base.- Parameters:
base-- Returns:
- self
-
types
-
types
-
addType
-
addType
-
addType
-
addTypeClosure
Adds an unrestricted set of bean types for the given type as if it represented a bean class of a managed bean.- Parameters:
typeName-DotNamerepresentation of a class that should be scanned for types- Returns:
- self
-
addTypeClosure
Adds an unrestricted set of bean types for the given type as if it represented a bean class of a managed bean.- Parameters:
type- a class that should be scanned for types- Returns:
- self
-
addTypeClosure
Adds an unrestricted set of bean types for the given type as if it represented a bean class of a managed bean.- Parameters:
type-Typerepresentation of a class that should be scanned for types- Returns:
- self
-
removeTypes
Removes listed types from the resulting types of the synthetic bean.- Parameters:
types- types that should be removed from the resulting set of bean types- Returns:
- self
-
removeTypes
Removes listed types from the resulting types of the synthetic bean.- Parameters:
types- types that should be removed from the resulting set of bean types- Returns:
- self
-
removeTypes
Removes listed types from the resulting types of the synthetic bean.- Parameters:
types- types that should be removed from the resulting set of bean types- Returns:
- self
-
addQualifier
-
addQualifier
-
addQualifier
-
addQualifier
-
qualifiers
-
scope
-
scope
-
name
-
named
Unlike thename(String)method, a newNamedqualifier with the specified value is added to the configured bean.- Parameters:
name-- Returns:
- self
-
defaultBean
-
unremovable
-
forceApplicationClass
Forces the bean to be considered an 'application class', so it will be defined in the runtime ClassLoader and re-created on each redeployment.- Returns:
- self
-
targetPackageName
-
alternative
-
priority
-
addStereotype
-
stereotypes
-
providerType
The provider type is the "real" type of the bean instance created viaInjectableReferenceProvider.get(CreationalContext).The container attempts to derive the provider type from the implementation class. However, in some cases it's better to specify it manually.
- Parameters:
providerType-- Returns:
- self
-
addInjectionPoint
public THIS addInjectionPoint(org.jboss.jandex.Type requiredType, org.jboss.jandex.AnnotationInstance... requiredQualifiers) Adds a synthetic injection point. The injection point is validated at build time and is also considered when removing unused beans.- Parameters:
requiredType-requiredQualifiers-- Returns:
- self
- See Also:
-
startup
Initialize the bean eagerly at application startup.If this bean is not active (see
checkActive(Consumer)) and is not injected into any always active bean, eager initialization is skipped to prevent needless failures.- Parameters:
priority- priority of the generated synthetic observer, to affect eager init ordering- Returns:
- self
-
startup
Initialize the bean eagerly at application startup.If this bean is not active (see
checkActive(Consumer)) and is not injected into any always active bean, eager initialization is skipped to prevent needless failures.- Returns:
- self
-
injectInterceptionProxy
Declares that this synthetic bean has an injection point of typeInterceptionProxy<PT>, wherePTis the provider type of this bean. An instance ofPTmay be used as a parameter toInterceptionProxy.create(Object)in the creator of this synthetic bean.The class of the provider type is scanned for interceptor binding annotations.
This method may only be called once. If called multiple times, the last call wins and the previous calls are lost.
- Returns:
- self
-
injectInterceptionProxy
Declares that this synthetic bean has an injection point of typeInterceptionProxy<PT>, wherePTis the provider type of this bean. An instance ofPTmay be used as a parameter toInterceptionProxy.create(Object)in the creator of this synthetic bean.If the
bindingsSourceis notnull, interceptor bindings on the class of the provider type are ignored; instead, thebindingsSourceclass is scanned for interceptor binding annotations as defined inBindingsSource.This method may only be called once. If called multiple times, the last call wins and the previous calls are lost.
- Parameters:
bindingsSource- the bindings source class, may benull- Returns:
- self
-
injectInterceptionProxy
Declares that this synthetic bean has an injection point of typeInterceptionProxy<PT>, wherePTis the provider type of this bean. An instance ofPTmay be used as a parameter toInterceptionProxy.create(Object)in the creator of this synthetic bean.If the
bindingsSourceis notnull, interceptor bindings on the class of the provider type are ignored; instead, thebindingsSourceclass is scanned for interceptor binding annotations as defined inBindingsSource.This method may only be called once. If called multiple times, the last call wins and the previous calls are lost.
- Parameters:
bindingsSource- the bindings source class, may benull- Returns:
- self
-
creator
-
creator
The first method parameter is the synthetic creational context, i.e. theMethodCreator#getMethodParam(0)returns aSyntheticCreationalContextinstance that can be used to obtain contextual references for synthetic injection points and build-time parameters.Furthermore, the consumer can also read the instance field of name
paramsand typeMap. This map holds all parameters set via one of theBeanConfigurator#param()methods.- Parameters:
methodCreatorConsumer-- Returns:
- self
-
destroyer
-
destroyer
-
checkActive
Configures the class of the "check active" procedure.- See Also:
-
checkActive
Configures the procedure that generates the bytecode for checking whether this bean is active or not. Usually, this method should not be called, because most beans are always active. However, certain synthetic beans may be inactive from time to time -- as determined by this procedure. If a bean is inactive, injecting it or looking it up ends withInactiveBeanException.The procedure is expected to return an
ActiveResult, which for inactive beans must include an explanation (why is this bean not active) and optionally also a cause (in case the bean is inactive because another bean is also inactive).- Returns:
- the procedure that generates the bytecode for checking whether this bean is active or not
-
identifier
The identifier becomes part of theBeanInfo.getIdentifier()andInjectableBean.getIdentifier().An identifier can be used to register multiple synthetic beans with the same set of types and qualifiers.
- Parameters:
identifier-- Returns:
- self
- See Also:
-
cast
-
accept
public void accept(org.jboss.jandex.AnnotationInstance qualifier)
-