Class BeanInjectionTarget<T>
- java.lang.Object
-
- org.jboss.weld.injection.producer.AbstractProducer<T>
-
- org.jboss.weld.injection.producer.BasicInjectionTarget<T>
-
- org.jboss.weld.injection.producer.BeanInjectionTarget<T>
-
- All Implemented Interfaces:
InjectionTarget<T>
,Producer<T>
,org.jboss.weld.manager.api.WeldInjectionTarget<T>
- Direct Known Subclasses:
DecoratorInjectionTarget
public class BeanInjectionTarget<T> extends BasicInjectionTarget<T>
- Author:
- Pete Muir, Jozef Hartinger
-
-
Field Summary
-
Fields inherited from class org.jboss.weld.injection.producer.BasicInjectionTarget
beanManager
-
-
Constructor Summary
Constructors Constructor Description BeanInjectionTarget(EnhancedAnnotatedType<T> type, Bean<T> bean, BeanManagerImpl beanManager)
BeanInjectionTarget(EnhancedAnnotatedType<T> type, Bean<T> bean, BeanManagerImpl beanManager, Injector<T> injector, LifecycleCallbackInvoker<T> invoker)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
buildInterceptionModel(EnhancedAnnotatedType<T> annotatedType, AbstractInstantiator<T> instantiator)
protected void
checkDecoratedMethods(EnhancedAnnotatedType<T> type, List<Decorator<?>> decorators)
protected void
checkNoArgsConstructor(EnhancedAnnotatedType<T> type)
static <T> BeanInjectionTarget<T>
createDefault(EnhancedAnnotatedType<T> type, Bean<T> bean, BeanManagerImpl beanManager)
void
dispose(T instance)
Destroys the instance.static <T> BeanInjectionTarget<T>
forCdiInterceptor(EnhancedAnnotatedType<T> type, Bean<T> bean, BeanManagerImpl manager)
Bean<T>
getBean()
Returns aBean
this producer is associated with or null if no such bean exists.void
initializeAfterBeanDiscovery(EnhancedAnnotatedType<T> annotatedType)
protected void
initializeInterceptionModel(EnhancedAnnotatedType<T> annotatedType)
protected boolean
isDecorator()
protected boolean
isInterceptionCandidate()
protected boolean
isInterceptor()
T
produce(CreationalContext<T> ctx)
Causes an instance to be produced via theProducer
.protected void
setupConstructorInterceptionInstantiator(InterceptionModel interceptionModel)
-
Methods inherited from class org.jboss.weld.injection.producer.BasicInjectionTarget
checkType, create, createDefault, createNonCdiInterceptor, getAnnotated, getAnnotatedType, getBeanManager, getInjectionPoints, getInjector, getInstantiator, getLifecycleCallbackInvoker, getType, hasDecorators, hasInterceptors, initInstantiator, inject, postConstruct, preDestroy, setInstantiator, toString
-
Methods inherited from class org.jboss.weld.injection.producer.AbstractProducer
checkDelegateInjectionPoints, equals, hashCode
-
-
-
-
Constructor Detail
-
BeanInjectionTarget
public BeanInjectionTarget(EnhancedAnnotatedType<T> type, Bean<T> bean, BeanManagerImpl beanManager, Injector<T> injector, LifecycleCallbackInvoker<T> invoker)
-
BeanInjectionTarget
public BeanInjectionTarget(EnhancedAnnotatedType<T> type, Bean<T> bean, BeanManagerImpl beanManager)
-
-
Method Detail
-
createDefault
public static <T> BeanInjectionTarget<T> createDefault(EnhancedAnnotatedType<T> type, Bean<T> bean, BeanManagerImpl beanManager)
-
forCdiInterceptor
public static <T> BeanInjectionTarget<T> forCdiInterceptor(EnhancedAnnotatedType<T> type, Bean<T> bean, BeanManagerImpl manager)
-
dispose
public void dispose(T instance)
Description copied from interface:Producer
Destroys the instance.
If the
Producer
represents a class, then this operation does nothing.If the
Producer
represents a producer field or method, this calls the disposer method, if any, on a contextual instance of the bean that declares the disposer method or performs any additional required cleanup, if any, to destroy state associated with a resource.
-
isInterceptor
protected boolean isInterceptor()
-
isDecorator
protected boolean isDecorator()
-
isInterceptionCandidate
protected boolean isInterceptionCandidate()
-
initializeInterceptionModel
protected void initializeInterceptionModel(EnhancedAnnotatedType<T> annotatedType)
-
buildInterceptionModel
protected void buildInterceptionModel(EnhancedAnnotatedType<T> annotatedType, AbstractInstantiator<T> instantiator)
-
initializeAfterBeanDiscovery
public void initializeAfterBeanDiscovery(EnhancedAnnotatedType<T> annotatedType)
- Overrides:
initializeAfterBeanDiscovery
in classBasicInjectionTarget<T>
-
setupConstructorInterceptionInstantiator
protected void setupConstructorInterceptionInstantiator(InterceptionModel interceptionModel)
-
checkNoArgsConstructor
protected void checkNoArgsConstructor(EnhancedAnnotatedType<T> type)
-
checkDecoratedMethods
protected void checkDecoratedMethods(EnhancedAnnotatedType<T> type, List<Decorator<?>> decorators)
-
produce
public T produce(CreationalContext<T> ctx)
Description copied from interface:Producer
Causes an instance to be produced via the
Producer
.If the
Producer
represents a class, this will invoke the constructor annotatedInject
if it exists, or the constructor with no parameters otherwise. If the class has interceptors,produce()
is responsible for building the interceptors and decorators of the instance.If the
Producer
represents a producer field or method, this will invoke the producer method on, or access the producer field of, a contextual instance of the bean that declares the producer.- Specified by:
produce
in interfaceProducer<T>
- Overrides:
produce
in classBasicInjectionTarget<T>
- Parameters:
ctx
- TheCreationalContext
to use for the produced object- Returns:
- the instance produced
-
getBean
public Bean<T> getBean()
Description copied from class:AbstractProducer
Returns aBean
this producer is associated with or null if no such bean exists.- Overrides:
getBean
in classBasicInjectionTarget<T>
-
-