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(java.util.function.Function<CreationalContext<U>,U> callback)
Set a
Function to create a bean instance from a CreationalContext |
BeanConfigurator<T> |
destroyWith(java.util.function.BiConsumer<T,CreationalContext<T>> callback)
Set a
BiConsumer to destroy a bean instance from a CreationalContext . |
BeanConfigurator<T> |
disposeWith(java.util.function.Consumer<T> callback)
Set a
Consumer 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(java.util.function.Function<Instance<Object>,U> callback)
|
<U extends T> |
produceWith(java.util.function.Supplier<U> callback)
Set a
Supplier to create a bean instance |
<U extends T> |
producing(U instance)
A shortcut for
produceWith(() -> existing where existing represents an instance whose lifecycle is not managed by CDI. |
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(java.util.function.Function<CreationalContext<U>,U> callback)
Function
to create a bean instance from a CreationalContext
callback
- the Function to create the instance<U extends T> BeanConfigurator<U> produceWith(java.util.function.Supplier<U> callback)
Supplier
to create a bean instancecallback
- the Supplier to create the instance<U extends T> BeanConfigurator<U> produceWith(java.util.function.Function<Instance<Object>,U> callback)
callback
- the function to create the instance<U extends T> BeanConfigurator<U> producing(U instance)
produceWith(() -> existing
where existing
represents an instance whose lifecycle is not managed by CDI.instance
- use as produced instance for the configured beanBeanConfigurator<T> destroyWith(java.util.function.BiConsumer<T,CreationalContext<T>> callback)
BiConsumer
to destroy a bean instance from a CreationalContext
.
If no destroy callback is specified, a NOOP dispose callback is automatically set.callback
- the BiConsumer to destroy the instanceBeanConfigurator<T> disposeWith(java.util.function.Consumer<T> callback)
Consumer
to destroy a bean instance.
If no dispose callback is specified, a NOOP dispose callback is automatically set.callback
- the Consumer 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 © 2008-2016 JBoss by Red Hat, Inc.. All Rights Reserved.