Package org.jboss.weld.bootstrap.event
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(Set<InjectionPoint> injectionPoints)Add InjectionPoints to the configured beanWeldBeanConfigurator<T>addInjectionPoints(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(Type type)Add a type to the bean typesWeldBeanConfigurator<T>addType(TypeLiteral<?> typeLiteral)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 implementsPassivationCapableand its Id for passivation.WeldBeanConfigurator<T>injectionPoints(Set<InjectionPoint> injectionPoints)Replace InjectionPoints for the configured beanWeldBeanConfigurator<T>injectionPoints(InjectionPoint... injectionPoints)Replace InjectionPoints for the configured beanWeldBeanConfigurator<T>name(String name)Set the name of the configured beanWeldBeanConfigurator<T>priority(int priority)Allows to set a priority to an alternative bean hence selecting it globally.<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: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
WeldBeanConfigurator<T> name(String 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
WeldBeanConfigurator<T> stereotypes(Set<Class<? extends Annotation>> 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
WeldBeanConfigurator<T> addStereotypes(Set<Class<? extends Annotation>> stereotypes)
Description copied from interface:BeanConfiguratorAdd stereotypes to the configured bean- Specified by:
addStereotypesin interfaceBeanConfigurator<T>- Parameters:
stereotypes- stereotypes to add- Returns:
- self
-
addStereotype
WeldBeanConfigurator<T> addStereotype(Class<? extends Annotation> stereotype)
Description copied from interface:BeanConfiguratorAdd a stereotype to the configured bean- Specified by:
addStereotypein interfaceBeanConfigurator<T>- Parameters:
stereotype- stereotype to add- Returns:
- self
-
qualifiers
WeldBeanConfigurator<T> qualifiers(Set<Annotation> qualifiers)
Description copied from interface:BeanConfiguratorReplace all qualifiers.- Specified by:
qualifiersin interfaceBeanConfigurator<T>- Parameters:
qualifiers- for the configured bean- Returns:
- self
-
qualifiers
WeldBeanConfigurator<T> qualifiers(Annotation... qualifiers)
Description copied from interface:BeanConfiguratorReplace all qualifiers.- Specified by:
qualifiersin interfaceBeanConfigurator<T>- Parameters:
qualifiers- qualifiers for the build bean- Returns:
- self
-
addQualifiers
WeldBeanConfigurator<T> addQualifiers(Set<Annotation> qualifiers)
Description copied from interface:BeanConfiguratorAdd qualifiers to the bean.- Specified by:
addQualifiersin interfaceBeanConfigurator<T>- Parameters:
qualifiers- qualifiers to add- Returns:
- self
-
addQualifiers
WeldBeanConfigurator<T> addQualifiers(Annotation... qualifiers)
Description copied from interface:BeanConfiguratorAdd qualifiers to the bean.- Specified by:
addQualifiersin interfaceBeanConfigurator<T>- Parameters:
qualifiers- qualifiers to add- Returns:
- self
-
addQualifier
WeldBeanConfigurator<T> addQualifier(Annotation qualifier)
Description copied from interface:BeanConfiguratorAdd a qualifier to the configured bean- Specified by:
addQualifierin interfaceBeanConfigurator<T>- Parameters:
qualifier- qualifier to add- Returns:
- self
-
scope
WeldBeanConfigurator<T> scope(Class<? extends Annotation> scope)
Description copied from interface:BeanConfiguratorReplace Bean scope- Specified by:
scopein interfaceBeanConfigurator<T>- Parameters:
scope- new scope for the configured bean- Returns:
- self
-
types
WeldBeanConfigurator<T> types(Set<Type> types)
Description copied from interface:BeanConfiguratorReplace bean types- Specified by:
typesin interfaceBeanConfigurator<T>- Parameters:
types- the types of the configured bean- Returns:
- self
-
types
WeldBeanConfigurator<T> types(Type... types)
Description copied from interface:BeanConfiguratorReplace bean types- Specified by:
typesin interfaceBeanConfigurator<T>- Parameters:
types- the types of the configured bean- Returns:
- self
-
addTransitiveTypeClosure
WeldBeanConfigurator<T> addTransitiveTypeClosure(Type type)
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
WeldBeanConfigurator<T> addTypes(Set<Type> types)
Description copied from interface:BeanConfiguratorAdd types to the bean types- Specified by:
addTypesin interfaceBeanConfigurator<T>- Parameters:
types- types to add- Returns:
- self
-
addTypes
WeldBeanConfigurator<T> addTypes(Type... types)
Description copied from interface:BeanConfiguratorAdd types to the bean types- Specified by:
addTypesin interfaceBeanConfigurator<T>- Parameters:
types- types to add- Returns:
- self
-
addType
WeldBeanConfigurator<T> addType(TypeLiteral<?> typeLiteral)
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
WeldBeanConfigurator<T> addType(Type type)
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
WeldBeanConfigurator<T> read(BeanAttributes<?> beanAttributes)
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
<U extends T> WeldBeanConfigurator<U> read(AnnotatedType<U> type)
Description copied from interface:BeanConfiguratorRead the information from the given annotated type. All relevant information is overwritten.- Specified by:
readin interfaceBeanConfigurator<T>- Parameters:
type- class to read information from- Returns:
- self
-
disposeWith
WeldBeanConfigurator<T> disposeWith(BiConsumer<T,Instance<Object>> callback)
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
WeldBeanConfigurator<T> destroyWith(BiConsumer<T,CreationalContext<T>> callback)
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
<U extends T> WeldBeanConfigurator<U> produceWith(Function<Instance<Object>,U> callback)
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>- 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:BeanConfiguratorSet a callback to create a bean instance.- Specified by:
createWithin interfaceBeanConfigurator<T>- 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:BeanConfiguratorMake the configured bean implementsPassivationCapableand its Id for passivation.- Specified by:
idin interfaceBeanConfigurator<T>- Parameters:
id- for- Returns:
- self
- See Also:
PassivationCapable.getId()
-
injectionPoints
WeldBeanConfigurator<T> injectionPoints(Set<InjectionPoint> 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
WeldBeanConfigurator<T> injectionPoints(InjectionPoint... 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
WeldBeanConfigurator<T> addInjectionPoints(Set<InjectionPoint> injectionPoints)
Description copied from interface:BeanConfiguratorAdd InjectionPoints to the configured bean- Specified by:
addInjectionPointsin interfaceBeanConfigurator<T>- Parameters:
injectionPoints- the injectionPoints to add- Returns:
- self
-
addInjectionPoints
WeldBeanConfigurator<T> addInjectionPoints(InjectionPoint... injectionPoints)
Description copied from interface:BeanConfiguratorAdd InjectionPoints to the configured bean- Specified by:
addInjectionPointsin interfaceBeanConfigurator<T>- Parameters:
injectionPoints- the injectionPoints to add- Returns:
- self
-
addInjectionPoint
WeldBeanConfigurator<T> addInjectionPoint(InjectionPoint injectionPoint)
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
WeldBeanConfigurator<T> beanClass(Class<?> 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
WeldBeanConfigurator<T> priority(int priority)
Allows to set a priority to an alternative bean hence selecting it globally. Has the same effect as puttingInterceptor.Priorityannotation on an actual bean class or implementingPrioritizedinterface with custom bean classes. This method has no effect on custom beans which are not alternatives.- Parameters:
priority- the priority of this bean- Returns:
- self
-
-