T
- the class of the bean instancepublic interface BeanConfigurator<T>
Bean
instance.
CDI container must provides an implementation of this interface.
This builder is not thread safe and shall not be used concurrently.AfterBeanDiscovery.addBean()
Modifier and Type | Method and Description |
---|---|
BeanConfigurator<T> |
addInjectionPoint(InjectionPoint injectionPoint)
Add an InjectionPoint to the configured bean
|
BeanConfigurator<T> |
addInjectionPoints(InjectionPoint... injectionPoints)
Add InjectionPoints to the configured bean
|
BeanConfigurator<T> |
addInjectionPoints(Set<InjectionPoint> injectionPoints)
Add InjectionPoints to the configured bean
|
BeanConfigurator<T> |
addQualifier(Annotation qualifier)
Add a qualifier to the configured bean
|
BeanConfigurator<T> |
addQualifiers(Annotation... qualifiers)
Add qualifiers to the bean.
|
BeanConfigurator<T> |
addQualifiers(Set<Annotation> qualifiers)
Add qualifiers to the bean.
|
BeanConfigurator<T> |
addStereotype(Class<? extends Annotation> stereotype)
Add a stereotype to the configured bean
|
BeanConfigurator<T> |
addStereotypes(Set<Class<? extends Annotation>> stereotypes)
Add stereotypes to the configured bean
|
BeanConfigurator<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.
|
BeanConfigurator<T> |
addType(Type type)
Add a type to the bean types
|
BeanConfigurator<T> |
addType(TypeLiteral<?> typeLiteral)
Add a type to the bean types
|
BeanConfigurator<T> |
addTypes(Set<Type> types)
Add types to the bean types
|
BeanConfigurator<T> |
addTypes(Type... types)
Add types to the bean types
|
BeanConfigurator<T> |
alternative(boolean value)
Change the alternative status of the configured bean.
|
BeanConfigurator<T> |
beanClass(Class<?> beanClass)
Set the class of the configured Bean.
|
<U extends T> |
createWith(Function<CreationalContext<U>,U> callback)
Set a callback to create a bean instance.
|
BeanConfigurator<T> |
destroyWith(BiConsumer<T,CreationalContext<T>> callback)
Set a callback to destroy a bean instance.
|
BeanConfigurator<T> |
disposeWith(BiConsumer<T,Instance<Object>> callback)
Set a callback to destroy a bean instance.
|
BeanConfigurator<T> |
id(String id)
Make the configured bean implements
PassivationCapable and its Id for passivation. |
BeanConfigurator<T> |
injectionPoints(InjectionPoint... injectionPoints)
Replace InjectionPoints for the configured bean
|
BeanConfigurator<T> |
injectionPoints(Set<InjectionPoint> injectionPoints)
Replace InjectionPoints for the configured bean
|
BeanConfigurator<T> |
name(String name)
Set the name of the configured bean
|
<U extends T> |
produceWith(Function<Instance<Object>,U> callback)
Set a callback to create a bean instance.
|
BeanConfigurator<T> |
qualifiers(Annotation... qualifiers)
Replace all qualifiers.
|
BeanConfigurator<T> |
qualifiers(Set<Annotation> qualifiers)
Replace all qualifiers.
|
<U extends T> |
read(AnnotatedType<U> type)
Read the information from the given annotated type.
|
BeanConfigurator<T> |
read(BeanAttributes<?> beanAttributes)
Read the information from the given bean attributes.
|
BeanConfigurator<T> |
scope(Class<? extends Annotation> scope)
Replace Bean scope
|
BeanConfigurator<T> |
stereotypes(Set<Class<? extends Annotation>> stereotypes)
Replace stereotypes on the configured bean
|
BeanConfigurator<T> |
types(Set<Type> types)
Replace bean types
|
BeanConfigurator<T> |
types(Type... types)
Replace bean types
|
BeanConfigurator<T> beanClass(Class<?> beanClass)
beanClass
- class of the configured beanBeanConfigurator<T> addInjectionPoint(InjectionPoint injectionPoint)
injectionPoint
- the injectionPoint to addBeanConfigurator<T> addInjectionPoints(InjectionPoint... injectionPoints)
injectionPoints
- the injectionPoints to addBeanConfigurator<T> addInjectionPoints(Set<InjectionPoint> injectionPoints)
injectionPoints
- the injectionPoints to addBeanConfigurator<T> injectionPoints(InjectionPoint... injectionPoints)
injectionPoints
- the injectionPoints for the configured beanBeanConfigurator<T> injectionPoints(Set<InjectionPoint> injectionPoints)
injectionPoints
- the injectionPoints for the configured beanBeanConfigurator<T> id(String id)
PassivationCapable
and its Id for passivation.id
- forPassivationCapable.getId()
<U extends T> BeanConfigurator<U> createWith(Function<CreationalContext<U>,U> callback)
callback
- the callback to create the instanceContextual.create(CreationalContext)
<U extends T> BeanConfigurator<U> produceWith(Function<Instance<Object>,U> callback)
The Instance
argument might be used to simulate producer method parameter injection. However, dependent scoped
bean instances obtained from Instance
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 from Instance
.
callback
- the callback to create the instanceBeanConfigurator<T> destroyWith(BiConsumer<T,CreationalContext<T>> callback)
If no destroy callback is specified, a NOOP callback is automatically set.
callback
- the callback to destroy the instanceBeanConfigurator<T> disposeWith(BiConsumer<T,Instance<Object>> callback)
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 from Instance
during the callback execution are destroyed when the execution completes.
callback
- the callback to dispose the instance<U extends T> BeanConfigurator<U> read(AnnotatedType<U> type)
type
- class to read information fromBeanConfigurator<T> read(BeanAttributes<?> beanAttributes)
beanAttributes
- beanAttributes to read information fromBeanConfigurator<T> addType(Type type)
type
- the type to addBeanConfigurator<T> addType(TypeLiteral<?> typeLiteral)
typeLiteral
- the type to addBeanConfigurator<T> addTypes(Type... types)
types
- types to addBeanConfigurator<T> addTypes(Set<Type> types)
types
- types to addBeanConfigurator<T> addTransitiveTypeClosure(Type type)
type
- to build the closure fromBeanConfigurator<T> types(Type... types)
types
- the types of the configured beanBeanConfigurator<T> types(Set<Type> types)
types
- the types of the configured beanBeanConfigurator<T> scope(Class<? extends Annotation> scope)
scope
- new scope for the configured beanBeanConfigurator<T> addQualifier(Annotation qualifier)
qualifier
- qualifier to addBeanConfigurator<T> addQualifiers(Annotation... qualifiers)
qualifiers
- qualifiers to addBeanConfigurator<T> addQualifiers(Set<Annotation> qualifiers)
qualifiers
- qualifiers to addBeanConfigurator<T> qualifiers(Annotation... qualifiers)
qualifiers
- qualifiers for the build beanBeanConfigurator<T> qualifiers(Set<Annotation> qualifiers)
qualifiers
- for the configured beanBeanConfigurator<T> addStereotype(Class<? extends Annotation> stereotype)
stereotype
- stereotype to addBeanConfigurator<T> addStereotypes(Set<Class<? extends Annotation>> stereotypes)
stereotypes
- stereotypes to addBeanConfigurator<T> stereotypes(Set<Class<? extends Annotation>> stereotypes)
stereotypes
- for the configured beanBeanConfigurator<T> name(String name)
name
- name for the configured beanBeanConfigurator<T> alternative(boolean value)
value
- value for alternative propertyCopyright © 1996-2017, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.