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 voidbuildInterceptionModel(EnhancedAnnotatedType<T> annotatedType, AbstractInstantiator<T> instantiator)protected voidcheckDecoratedMethods(EnhancedAnnotatedType<T> type, List<Decorator<?>> decorators)protected voidcheckNoArgsConstructor(EnhancedAnnotatedType<T> type)static <T> BeanInjectionTarget<T>createDefault(EnhancedAnnotatedType<T> type, Bean<T> bean, BeanManagerImpl beanManager)voiddispose(T instance)Destroys the instance.static <T> BeanInjectionTarget<T>forCdiInterceptor(EnhancedAnnotatedType<T> type, Bean<T> bean, BeanManagerImpl manager)Bean<T>getBean()Returns aBeanthis producer is associated with or null if no such bean exists.voidinitializeAfterBeanDiscovery(EnhancedAnnotatedType<T> annotatedType)protected voidinitializeInterceptionModel(EnhancedAnnotatedType<T> annotatedType)protected booleanisDecorator()protected booleanisInterceptionCandidate()protected booleanisInterceptor()Tproduce(CreationalContext<T> ctx)Causes an instance to be produced via theProducer.protected voidsetupConstructorInterceptionInstantiator(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:ProducerDestroys the instance.
If the
Producerrepresents a class, then this operation does nothing.If the
Producerrepresents 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:
initializeAfterBeanDiscoveryin 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:ProducerCauses an instance to be produced via the
Producer.If the
Producerrepresents a class, this will invoke the constructor annotatedInjectif 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
Producerrepresents 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:
producein interfaceProducer<T>- Overrides:
producein classBasicInjectionTarget<T>- Parameters:
ctx- TheCreationalContextto use for the produced object- Returns:
- the instance produced
-
getBean
public Bean<T> getBean()
Description copied from class:AbstractProducerReturns aBeanthis producer is associated with or null if no such bean exists.- Overrides:
getBeanin classBasicInjectionTarget<T>
-
-