public abstract class AbstractInjectionTarget<T> extends AbstractProducer<T> implements InjectionTarget<T>
| Modifier and Type | Field and Description |
|---|---|
protected BeanManagerImpl |
beanManager |
| Constructor and Description |
|---|
AbstractInjectionTarget(EnhancedAnnotatedType<T> type,
Bean<T> bean,
BeanManagerImpl beanManager) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkDecoratedMethods(EnhancedAnnotatedType<T> type,
List<Decorator<?>> decorators) |
protected void |
checkType(EnhancedAnnotatedType<T> type) |
void |
dispose(T instance)
Destroys the instance.
|
AnnotatedType<T> |
getAnnotated() |
Bean<T> |
getBean()
Returns a
Bean this producer is associated with or null if no such bean exists. |
protected BeanManagerImpl |
getBeanManager() |
List<Set<MethodInjectionPoint<?,?>>> |
getInitializerMethods() |
List<Set<FieldInjectionPoint<?,?>>> |
getInjectableFields() |
Set<InjectionPoint> |
getInjectionPoints()
Returns the set of all
InjectionPoints. |
Instantiator<T> |
getInstantiator() |
List<AnnotatedMethod<? super T>> |
getPostConstructMethods() |
List<AnnotatedMethod<? super T>> |
getPreDestroyMethods() |
protected AnnotatedType<T> |
getType() |
boolean |
hasDecorators() |
boolean |
hasInterceptors() |
protected void |
initializeAfterBeanDiscovery(EnhancedAnnotatedType<T> annotatedType) |
protected abstract Instantiator<T> |
initInstantiator(EnhancedAnnotatedType<T> type,
Bean<T> bean,
BeanManagerImpl beanManager,
Set<InjectionPoint> injectionPoints)
Returns an instantiator that will be used to create a new instance of a given component.
|
protected boolean |
isDecorator() |
protected boolean |
isInterceptionCandidate() |
protected boolean |
isInterceptor() |
void |
postConstruct(T instance)
Calls the
PostConstruct callback, if it exists, according to the semantics required by the Java
EE platform specification. |
void |
preDestroy(T instance)
Calls the
PreDestroy callback, if it exists, according to the semantics required by the Java EE
platform specification. |
T |
produce(CreationalContext<T> ctx)
Causes an instance to be produced via the
Producer. |
void |
setInstantiator(Instantiator<T> instantiator) |
String |
toString() |
checkDelegateInjectionPoints, equals, hashCodeclone, finalize, getClass, notify, notifyAll, wait, wait, waitinjectprotected final BeanManagerImpl beanManager
public AbstractInjectionTarget(EnhancedAnnotatedType<T> type, Bean<T> bean, BeanManagerImpl beanManager)
protected void checkType(EnhancedAnnotatedType<T> type)
protected void checkDecoratedMethods(EnhancedAnnotatedType<T> type, List<Decorator<?>> decorators)
protected boolean isInterceptor()
protected boolean isDecorator()
protected boolean isInterceptionCandidate()
public T produce(CreationalContext<T> ctx)
Producer
Causes an instance to be produced via the Producer.
If the Producer represents a class, this will invoke the constructor annotated Inject 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.
produce in interface Producer<T>ctx - The CreationalContext to use for the produced objectpublic void postConstruct(T instance)
InjectionTarget
Calls the PostConstruct callback, if it exists, according to the semantics required by the Java
EE platform specification.
postConstruct in interface InjectionTarget<T>instance - The instance on which to invoke the PostConstruct methodpublic void preDestroy(T instance)
InjectionTarget
Calls the PreDestroy callback, if it exists, according to the semantics required by the Java EE
platform specification.
preDestroy in interface InjectionTarget<T>instance - The instance on which to invoke the PreDestroy methodpublic void dispose(T instance)
ProducerDestroys 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.
public Set<InjectionPoint> getInjectionPoints()
Producer
Returns the set of all InjectionPoints. If the Producer represents a class, then this returns returns the
set of InjectionPoint objects representing all injected fields, bean constructor parameters and initializer
method parameters. For a producer method, this returns the set of InjectionPoint objects representing all
parameters of the producer method.
getInjectionPoints in interface Producer<T>protected AnnotatedType<T> getType()
protected BeanManagerImpl getBeanManager()
public List<Set<FieldInjectionPoint<?,?>>> getInjectableFields()
public List<Set<MethodInjectionPoint<?,?>>> getInitializerMethods()
public Instantiator<T> getInstantiator()
public void setInstantiator(Instantiator<T> instantiator)
public Bean<T> getBean()
AbstractProducerBean this producer is associated with or null if no such bean exists.getBean in class AbstractProducer<T>public boolean hasInterceptors()
public boolean hasDecorators()
public List<AnnotatedMethod<? super T>> getPostConstructMethods()
public List<AnnotatedMethod<? super T>> getPreDestroyMethods()
protected void initializeAfterBeanDiscovery(EnhancedAnnotatedType<T> annotatedType)
protected abstract Instantiator<T> initInstantiator(EnhancedAnnotatedType<T> type, Bean<T> bean, BeanManagerImpl beanManager, Set<InjectionPoint> injectionPoints)
initInstantiator(EnhancedAnnotatedType, Bean, BeanManagerImpl, Set) method is supposed to register all these
injection points within the injectionPoints set passed in as a parameter.public AnnotatedType<T> getAnnotated()
getAnnotated in class AbstractProducer<T>Copyright © 2012 Seam Framework. All Rights Reserved.