Interface WeldBeanConfigurator<T>
-
- All Superinterfaces:
BeanConfigurator<T>
- All Known Implementing Classes:
BeanConfiguratorImpl
public interface WeldBeanConfigurator<T> extends BeanConfigurator<T>
Represents an enhanced version ofBeanConfigurator
- Author:
- Matej Novotny
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description WeldBeanConfigurator<T>
addInjectionPoint(InjectionPoint injectionPoint)
Add an InjectionPoint to the configured beanWeldBeanConfigurator<T>
addInjectionPoints(InjectionPoint... injectionPoints)
Add InjectionPoints to the configured beanWeldBeanConfigurator<T>
addInjectionPoints(Set<InjectionPoint> injectionPoints)
Add InjectionPoints to the configured beanWeldBeanConfigurator<T>
addQualifier(Annotation qualifier)
Add a qualifier to the configured beanWeldBeanConfigurator<T>
addQualifiers(Annotation... qualifiers)
Add qualifiers to the bean.WeldBeanConfigurator<T>
addQualifiers(Set<Annotation> qualifiers)
Add qualifiers to the bean.WeldBeanConfigurator<T>
addStereotype(Class<? extends Annotation> stereotype)
Add a stereotype to the configured beanWeldBeanConfigurator<T>
addStereotypes(Set<Class<? extends Annotation>> stereotypes)
Add stereotypes to the configured beanWeldBeanConfigurator<T>
addTransitiveTypeClosure(Type type)
Adds an unrestricted set of bean types for the given type as if it represented a bean class of a managed bean.WeldBeanConfigurator<T>
addType(TypeLiteral<?> typeLiteral)
Add a type to the bean typesWeldBeanConfigurator<T>
addType(Type type)
Add a type to the bean typesWeldBeanConfigurator<T>
addTypes(Type... types)
Add types to the bean typesWeldBeanConfigurator<T>
addTypes(Set<Type> types)
Add types to the bean typesWeldBeanConfigurator<T>
alternative(boolean value)
Change the alternative status of the configured bean.WeldBeanConfigurator<T>
beanClass(Class<?> beanClass)
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.WeldBeanConfigurator<T>
destroyWith(BiConsumer<T,CreationalContext<T>> callback)
Set a callback to destroy a bean instance.WeldBeanConfigurator<T>
disposeWith(BiConsumer<T,Instance<Object>> callback)
Set a callback to destroy a bean instance.WeldBeanConfigurator<T>
id(String id)
Make the configured bean implementsPassivationCapable
and its Id for passivation.WeldBeanConfigurator<T>
injectionPoints(InjectionPoint... injectionPoints)
Replace InjectionPoints for the configured beanWeldBeanConfigurator<T>
injectionPoints(Set<InjectionPoint> injectionPoints)
Replace InjectionPoints for the configured beanWeldBeanConfigurator<T>
name(String name)
Set the name of the configured beanWeldBeanConfigurator<T>
priority(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.WeldBeanConfigurator<T>
qualifiers(Annotation... qualifiers)
Replace all qualifiers.WeldBeanConfigurator<T>
qualifiers(Set<Annotation> qualifiers)
Replace all qualifiers.<U extends T>
WeldBeanConfigurator<U>read(AnnotatedType<U> type)
Read the information from the given annotated type.WeldBeanConfigurator<T>
read(BeanAttributes<?> beanAttributes)
Read the information from the given bean attributes.WeldBeanConfigurator<T>
scope(Class<? extends Annotation> scope)
Replace Bean scopeWeldBeanConfigurator<T>
stereotypes(Set<Class<? extends Annotation>> stereotypes)
Replace stereotypes on the configured beanWeldBeanConfigurator<T>
types(Type... types)
Replace bean typesWeldBeanConfigurator<T>
types(Set<Type> types)
Replace bean types
-
-
-
Method Detail
-
alternative
WeldBeanConfigurator<T> alternative(boolean value)
Description copied from interface:BeanConfigurator
Change the alternative status of the configured bean. By default the configured bean is not an alternative.- Specified by:
alternative
in interfaceBeanConfigurator<T>
- Parameters:
value
- value for alternative property- Returns:
- self
-
name
WeldBeanConfigurator<T> name(String name)
Description copied from interface:BeanConfigurator
Set the name of the configured bean- Specified by:
name
in interfaceBeanConfigurator<T>
- Parameters:
name
- name for the configured bean- Returns:
- self
-
stereotypes
WeldBeanConfigurator<T> stereotypes(Set<Class<? extends Annotation>> stereotypes)
Description copied from interface:BeanConfigurator
Replace stereotypes on the configured bean- Specified by:
stereotypes
in interfaceBeanConfigurator<T>
- Parameters:
stereotypes
- for the configured bean- Returns:
- self
-
addStereotypes
WeldBeanConfigurator<T> addStereotypes(Set<Class<? extends Annotation>> stereotypes)
Description copied from interface:BeanConfigurator
Add stereotypes to the configured bean- Specified by:
addStereotypes
in interfaceBeanConfigurator<T>
- Parameters:
stereotypes
- stereotypes to add- Returns:
- self
-
addStereotype
WeldBeanConfigurator<T> addStereotype(Class<? extends Annotation> stereotype)
Description copied from interface:BeanConfigurator
Add a stereotype to the configured bean- Specified by:
addStereotype
in interfaceBeanConfigurator<T>
- Parameters:
stereotype
- stereotype to add- Returns:
- self
-
qualifiers
WeldBeanConfigurator<T> qualifiers(Set<Annotation> qualifiers)
Description copied from interface:BeanConfigurator
Replace all qualifiers.- Specified by:
qualifiers
in interfaceBeanConfigurator<T>
- Parameters:
qualifiers
- for the configured bean- Returns:
- self
-
qualifiers
WeldBeanConfigurator<T> qualifiers(Annotation... qualifiers)
Description copied from interface:BeanConfigurator
Replace all qualifiers.- Specified by:
qualifiers
in interfaceBeanConfigurator<T>
- Parameters:
qualifiers
- qualifiers for the build bean- Returns:
- self
-
addQualifiers
WeldBeanConfigurator<T> addQualifiers(Set<Annotation> qualifiers)
Description copied from interface:BeanConfigurator
Add qualifiers to the bean.- Specified by:
addQualifiers
in interfaceBeanConfigurator<T>
- Parameters:
qualifiers
- qualifiers to add- Returns:
- self
-
addQualifiers
WeldBeanConfigurator<T> addQualifiers(Annotation... qualifiers)
Description copied from interface:BeanConfigurator
Add qualifiers to the bean.- Specified by:
addQualifiers
in interfaceBeanConfigurator<T>
- Parameters:
qualifiers
- qualifiers to add- Returns:
- self
-
addQualifier
WeldBeanConfigurator<T> addQualifier(Annotation qualifier)
Description copied from interface:BeanConfigurator
Add a qualifier to the configured bean- Specified by:
addQualifier
in interfaceBeanConfigurator<T>
- Parameters:
qualifier
- qualifier to add- Returns:
- self
-
scope
WeldBeanConfigurator<T> scope(Class<? extends Annotation> scope)
Description copied from interface:BeanConfigurator
Replace Bean scope- Specified by:
scope
in interfaceBeanConfigurator<T>
- Parameters:
scope
- new scope for the configured bean- Returns:
- self
-
types
WeldBeanConfigurator<T> types(Set<Type> types)
Description copied from interface:BeanConfigurator
Replace bean types- Specified by:
types
in interfaceBeanConfigurator<T>
- Parameters:
types
- the types of the configured bean- Returns:
- self
-
types
WeldBeanConfigurator<T> types(Type... types)
Description copied from interface:BeanConfigurator
Replace bean types- Specified by:
types
in interfaceBeanConfigurator<T>
- Parameters:
types
- the types of the configured bean- Returns:
- self
-
addTransitiveTypeClosure
WeldBeanConfigurator<T> addTransitiveTypeClosure(Type type)
Description copied from interface:BeanConfigurator
Adds 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:
addTransitiveTypeClosure
in interfaceBeanConfigurator<T>
- Parameters:
type
- to build the closure from- Returns:
- self
-
addTypes
WeldBeanConfigurator<T> addTypes(Set<Type> types)
Description copied from interface:BeanConfigurator
Add types to the bean types- Specified by:
addTypes
in interfaceBeanConfigurator<T>
- Parameters:
types
- types to add- Returns:
- self
-
addTypes
WeldBeanConfigurator<T> addTypes(Type... types)
Description copied from interface:BeanConfigurator
Add types to the bean types- Specified by:
addTypes
in interfaceBeanConfigurator<T>
- Parameters:
types
- types to add- Returns:
- self
-
addType
WeldBeanConfigurator<T> addType(TypeLiteral<?> typeLiteral)
Description copied from interface:BeanConfigurator
Add a type to the bean types- Specified by:
addType
in interfaceBeanConfigurator<T>
- Parameters:
typeLiteral
- the type to add- Returns:
- self
-
addType
WeldBeanConfigurator<T> addType(Type type)
Description copied from interface:BeanConfigurator
Add a type to the bean types- Specified by:
addType
in interfaceBeanConfigurator<T>
- Parameters:
type
- the type to add- Returns:
- self
-
read
WeldBeanConfigurator<T> read(BeanAttributes<?> beanAttributes)
Description copied from interface:BeanConfigurator
Read the information from the given bean attributes. All relevant information is overwritten.- Specified by:
read
in interfaceBeanConfigurator<T>
- Parameters:
beanAttributes
- beanAttributes to read information from- Returns:
- self
-
read
<U extends T> WeldBeanConfigurator<U> read(AnnotatedType<U> type)
Description copied from interface:BeanConfigurator
Read the information from the given annotated type. All relevant information is overwritten.- Specified by:
read
in interfaceBeanConfigurator<T>
- Type Parameters:
U
- instance type- Parameters:
type
- class to read information from- Returns:
- self
-
disposeWith
WeldBeanConfigurator<T> disposeWith(BiConsumer<T,Instance<Object>> callback)
Description copied from interface:BeanConfigurator
Set a callback to destroy a bean instance.If no dispose callback is specified, a NOOP callback is automatically set.
The
Instance
argument might be used to simulate disposer method parameter injection. All dependent scoped bean instances obtained fromInstance
during the callback execution are destroyed when the execution completes.- Specified by:
disposeWith
in interfaceBeanConfigurator<T>
- Parameters:
callback
- the callback to dispose the instance- Returns:
- self
-
destroyWith
WeldBeanConfigurator<T> destroyWith(BiConsumer<T,CreationalContext<T>> callback)
Description copied from interface:BeanConfigurator
Set a callback to destroy a bean instance.If no destroy callback is specified, a NOOP callback is automatically set.
- Specified by:
destroyWith
in interfaceBeanConfigurator<T>
- Parameters:
callback
- the callback to destroy the instance- Returns:
- self
-
produceWith
<U extends T> WeldBeanConfigurator<U> produceWith(Function<Instance<Object>,U> callback)
Description copied from interface:BeanConfigurator
Set a callback to create a bean instance.The
Instance
argument might be used to simulate producer method parameter injection. However, dependent scoped bean instances obtained fromInstance
during 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:
produceWith
in interfaceBeanConfigurator<T>
- Type Parameters:
U
- instance type- Parameters:
callback
- the callback to create the instance- Returns:
- self
-
createWith
<U extends T> WeldBeanConfigurator<U> createWith(Function<CreationalContext<U>,U> callback)
Description copied from interface:BeanConfigurator
Set a callback to create a bean instance.- Specified by:
createWith
in interfaceBeanConfigurator<T>
- Type Parameters:
U
- instance type- Parameters:
callback
- the callback to create the instance- Returns:
- self
- See Also:
Contextual.create(CreationalContext)
-
id
WeldBeanConfigurator<T> id(String id)
Description copied from interface:BeanConfigurator
Make the configured bean implementsPassivationCapable
and its Id for passivation.- Specified by:
id
in interfaceBeanConfigurator<T>
- Parameters:
id
- for- Returns:
- self
- See Also:
PassivationCapable.getId()
-
injectionPoints
WeldBeanConfigurator<T> injectionPoints(Set<InjectionPoint> injectionPoints)
Description copied from interface:BeanConfigurator
Replace InjectionPoints for the configured bean- Specified by:
injectionPoints
in interfaceBeanConfigurator<T>
- Parameters:
injectionPoints
- the injectionPoints for the configured bean- Returns:
- self
-
injectionPoints
WeldBeanConfigurator<T> injectionPoints(InjectionPoint... injectionPoints)
Description copied from interface:BeanConfigurator
Replace InjectionPoints for the configured bean- Specified by:
injectionPoints
in interfaceBeanConfigurator<T>
- Parameters:
injectionPoints
- the injectionPoints for the configured bean- Returns:
- self
-
addInjectionPoints
WeldBeanConfigurator<T> addInjectionPoints(Set<InjectionPoint> injectionPoints)
Description copied from interface:BeanConfigurator
Add InjectionPoints to the configured bean- Specified by:
addInjectionPoints
in interfaceBeanConfigurator<T>
- Parameters:
injectionPoints
- the injectionPoints to add- Returns:
- self
-
addInjectionPoints
WeldBeanConfigurator<T> addInjectionPoints(InjectionPoint... injectionPoints)
Description copied from interface:BeanConfigurator
Add InjectionPoints to the configured bean- Specified by:
addInjectionPoints
in interfaceBeanConfigurator<T>
- Parameters:
injectionPoints
- the injectionPoints to add- Returns:
- self
-
addInjectionPoint
WeldBeanConfigurator<T> addInjectionPoint(InjectionPoint injectionPoint)
Description copied from interface:BeanConfigurator
Add an InjectionPoint to the configured bean- Specified by:
addInjectionPoint
in interfaceBeanConfigurator<T>
- Parameters:
injectionPoint
- the injectionPoint to add- Returns:
- self
-
beanClass
WeldBeanConfigurator<T> beanClass(Class<?> beanClass)
Description copied from interface:BeanConfigurator
Set the class of the configured Bean. If not set, the extension class is used.- Specified by:
beanClass
in interfaceBeanConfigurator<T>
- Parameters:
beanClass
- class of the configured bean- Returns:
- self
-
priority
WeldBeanConfigurator<T> priority(int 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.Priority
annotation on an actual bean class or implementingPrioritized
interface with custom bean classes. This method has no effect on custom beans which are not alternatives.- Specified by:
priority
in interfaceBeanConfigurator<T>
- Parameters:
priority
- the priority of this bean- Returns:
- self
-
-