Interface WeldBeanConfigurator<T>
- All Superinterfaces:
BeanConfigurator<T>
BeanConfigurator- Author:
- Matej Novotny
-
Method Summary
Modifier and TypeMethodDescriptionaddInjectionPoint(InjectionPoint injectionPoint) Add an InjectionPoint to the configured beanaddInjectionPoints(InjectionPoint... injectionPoints) Add InjectionPoints to the configured beanaddInjectionPoints(Set<InjectionPoint> injectionPoints) Add InjectionPoints to the configured beanaddQualifier(Annotation qualifier) Add a qualifier to the configured beanaddQualifiers(Annotation... qualifiers) Add qualifiers to the bean.addQualifiers(Set<Annotation> qualifiers) Add qualifiers to the bean.addStereotype(Class<? extends Annotation> stereotype) Add a stereotype to the configured beanaddStereotypes(Set<Class<? extends Annotation>> stereotypes) Add stereotypes to the configured beanaddTransitiveTypeClosure(Type type) Adds an unrestricted set of bean types for the given type as if it represented a bean class of a managed bean.addType(TypeLiteral<?> typeLiteral) Add a type to the bean typesAdd a type to the bean typesAdd types to the bean typesAdd types to the bean typesalternative(boolean value) Change the alternative status of the configured bean.Set the class of the configured Bean.<U extends T>
WeldBeanConfigurator<U>createWith(Function<CreationalContext<U>, U> callback) Set a callback to create a bean instance.destroyWith(BiConsumer<T, CreationalContext<T>> callback) Set a callback to destroy a bean instance.disposeWith(BiConsumer<T, Instance<Object>> callback) Set a callback to destroy a bean instance.Make the configured bean implementsPassivationCapableand its Id for passivation.injectionPoints(InjectionPoint... injectionPoints) Replace InjectionPoints for the configured beaninjectionPoints(Set<InjectionPoint> injectionPoints) Replace InjectionPoints for the configured beanSet the name of the configured beanpriority(int priority) NOTE: Since CDI 4.0, this is now part of standard API!<U extends T>
WeldBeanConfigurator<U>produceWith(Function<Instance<Object>, U> callback) Set a callback to create a bean instance.qualifiers(Annotation... qualifiers) Replace all qualifiers.qualifiers(Set<Annotation> qualifiers) Replace all qualifiers.<U extends T>
WeldBeanConfigurator<U>read(AnnotatedType<U> type) Read the information from the given annotated type.read(BeanAttributes<?> beanAttributes) Read the information from the given bean attributes.scope(Class<? extends Annotation> scope) Replace Bean scopestereotypes(Set<Class<? extends Annotation>> stereotypes) Replace stereotypes on the configured beanReplace bean typesReplace bean types
-
Method Details
-
alternative
Description copied from interface:BeanConfiguratorChange the alternative status of the configured bean. By default the configured bean is not an alternative.- Specified by:
alternativein interfaceBeanConfigurator<T>- Parameters:
value- value for alternative property- Returns:
- self
-
name
Description copied from interface:BeanConfiguratorSet the name of the configured bean- Specified by:
namein interfaceBeanConfigurator<T>- Parameters:
name- name for the configured bean- Returns:
- self
-
stereotypes
Description copied from interface:BeanConfiguratorReplace stereotypes on the configured bean- Specified by:
stereotypesin interfaceBeanConfigurator<T>- Parameters:
stereotypes- for the configured bean- Returns:
- self
-
addStereotypes
Description copied from interface:BeanConfiguratorAdd stereotypes to the configured bean- Specified by:
addStereotypesin interfaceBeanConfigurator<T>- Parameters:
stereotypes- stereotypes to add- Returns:
- self
-
addStereotype
Description copied from interface:BeanConfiguratorAdd a stereotype to the configured bean- Specified by:
addStereotypein interfaceBeanConfigurator<T>- Parameters:
stereotype- stereotype to add- Returns:
- self
-
qualifiers
Description copied from interface:BeanConfiguratorReplace all qualifiers.- Specified by:
qualifiersin interfaceBeanConfigurator<T>- Parameters:
qualifiers- for the configured bean- Returns:
- self
-
qualifiers
Description copied from interface:BeanConfiguratorReplace all qualifiers.- Specified by:
qualifiersin interfaceBeanConfigurator<T>- Parameters:
qualifiers- qualifiers for the build bean- Returns:
- self
-
addQualifiers
Description copied from interface:BeanConfiguratorAdd qualifiers to the bean.- Specified by:
addQualifiersin interfaceBeanConfigurator<T>- Parameters:
qualifiers- qualifiers to add- Returns:
- self
-
addQualifiers
Description copied from interface:BeanConfiguratorAdd qualifiers to the bean.- Specified by:
addQualifiersin interfaceBeanConfigurator<T>- Parameters:
qualifiers- qualifiers to add- Returns:
- self
-
addQualifier
Description copied from interface:BeanConfiguratorAdd a qualifier to the configured bean- Specified by:
addQualifierin interfaceBeanConfigurator<T>- Parameters:
qualifier- qualifier to add- Returns:
- self
-
scope
Description copied from interface:BeanConfiguratorReplace Bean scope- Specified by:
scopein interfaceBeanConfigurator<T>- Parameters:
scope- new scope for the configured bean- Returns:
- self
-
types
Description copied from interface:BeanConfiguratorReplace bean types- Specified by:
typesin interfaceBeanConfigurator<T>- Parameters:
types- the types of the configured bean- Returns:
- self
-
types
Description copied from interface:BeanConfiguratorReplace bean types- Specified by:
typesin interfaceBeanConfigurator<T>- Parameters:
types- the types of the configured bean- Returns:
- self
-
addTransitiveTypeClosure
Description copied from interface:BeanConfiguratorAdds an unrestricted set of bean types for the given type as if it represented a bean class of a managed bean. Illegal bean types are omitted.- Specified by:
addTransitiveTypeClosurein interfaceBeanConfigurator<T>- Parameters:
type- to build the closure from- Returns:
- self
-
addTypes
Description copied from interface:BeanConfiguratorAdd types to the bean types- Specified by:
addTypesin interfaceBeanConfigurator<T>- Parameters:
types- types to add- Returns:
- self
-
addTypes
Description copied from interface:BeanConfiguratorAdd types to the bean types- Specified by:
addTypesin interfaceBeanConfigurator<T>- Parameters:
types- types to add- Returns:
- self
-
addType
Description copied from interface:BeanConfiguratorAdd a type to the bean types- Specified by:
addTypein interfaceBeanConfigurator<T>- Parameters:
typeLiteral- the type to add- Returns:
- self
-
addType
Description copied from interface:BeanConfiguratorAdd a type to the bean types- Specified by:
addTypein interfaceBeanConfigurator<T>- Parameters:
type- the type to add- Returns:
- self
-
read
Description copied from interface:BeanConfiguratorRead the information from the given bean attributes. All relevant information is overwritten.- Specified by:
readin interfaceBeanConfigurator<T>- Parameters:
beanAttributes- beanAttributes to read information from- Returns:
- self
-
read
Description copied from interface:BeanConfiguratorRead the information from the given annotated type. All relevant information is overwritten.- Specified by:
readin interfaceBeanConfigurator<T>- Type Parameters:
U- instance type- Parameters:
type- class to read information from- Returns:
- self
-
disposeWith
Description copied from interface:BeanConfiguratorSet a callback to destroy a bean instance.If no dispose callback is specified, a NOOP callback is automatically set.
The
Instanceargument might be used to simulate disposer method parameter injection. All dependent scoped bean instances obtained fromInstanceduring the callback execution are destroyed when the execution completes.- Specified by:
disposeWithin interfaceBeanConfigurator<T>- Parameters:
callback- the callback to dispose the instance- Returns:
- self
-
destroyWith
Description copied from interface:BeanConfiguratorSet a callback to destroy a bean instance.If no destroy callback is specified, a NOOP callback is automatically set.
- Specified by:
destroyWithin interfaceBeanConfigurator<T>- Parameters:
callback- the callback to destroy the instance- Returns:
- self
-
produceWith
Description copied from interface:BeanConfiguratorSet a callback to create a bean instance.The
Instanceargument might be used to simulate producer method parameter injection. However, dependent scoped bean instances obtained fromInstanceduring the callback execution remain managed until the produced bean instance is destroyed. Therefore, applications are encouraged to always destroy unneeded dependent scoped bean instances obtained fromInstance.- Specified by:
produceWithin interfaceBeanConfigurator<T>- Type Parameters:
U- instance type- Parameters:
callback- the callback to create the instance- Returns:
- self
-
createWith
Description copied from interface:BeanConfiguratorSet a callback to create a bean instance.- Specified by:
createWithin interfaceBeanConfigurator<T>- Type Parameters:
U- instance type- Parameters:
callback- the callback to create the instance- Returns:
- self
- See Also:
-
id
Description copied from interface:BeanConfiguratorMake the configured bean implementsPassivationCapableand its Id for passivation.- Specified by:
idin interfaceBeanConfigurator<T>- Parameters:
id- for- Returns:
- self
- See Also:
-
injectionPoints
Description copied from interface:BeanConfiguratorReplace InjectionPoints for the configured bean- Specified by:
injectionPointsin interfaceBeanConfigurator<T>- Parameters:
injectionPoints- the injectionPoints for the configured bean- Returns:
- self
-
injectionPoints
Description copied from interface:BeanConfiguratorReplace InjectionPoints for the configured bean- Specified by:
injectionPointsin interfaceBeanConfigurator<T>- Parameters:
injectionPoints- the injectionPoints for the configured bean- Returns:
- self
-
addInjectionPoints
Description copied from interface:BeanConfiguratorAdd InjectionPoints to the configured bean- Specified by:
addInjectionPointsin interfaceBeanConfigurator<T>- Parameters:
injectionPoints- the injectionPoints to add- Returns:
- self
-
addInjectionPoints
Description copied from interface:BeanConfiguratorAdd InjectionPoints to the configured bean- Specified by:
addInjectionPointsin interfaceBeanConfigurator<T>- Parameters:
injectionPoints- the injectionPoints to add- Returns:
- self
-
addInjectionPoint
Description copied from interface:BeanConfiguratorAdd an InjectionPoint to the configured bean- Specified by:
addInjectionPointin interfaceBeanConfigurator<T>- Parameters:
injectionPoint- the injectionPoint to add- Returns:
- self
-
beanClass
Description copied from interface:BeanConfiguratorSet the class of the configured Bean. If not set, the extension class is used.- Specified by:
beanClassin interfaceBeanConfigurator<T>- Parameters:
beanClass- class of the configured bean- Returns:
- self
-
priority
NOTE: Since CDI 4.0, this is now part of standard API!Allows to set a priority to an alternative bean hence selecting it globally. Has the same effect as putting
Interceptor.Priorityannotation on an actual bean class or implementingPrioritizedinterface with custom bean classes. This method has no effect on custom beans which are not alternatives.- Specified by:
priorityin interfaceBeanConfigurator<T>- Parameters:
priority- the priority of this bean- Returns:
- self
-