Class ForwardingInjectionTarget<T>
- java.lang.Object
-
- org.jboss.weld.injection.ForwardingInjectionTarget<T>
-
- All Implemented Interfaces:
InjectionTarget<T>,Producer<T>
public abstract class ForwardingInjectionTarget<T> extends Object implements InjectionTarget<T>
- Author:
- Stuart Douglas
-
-
Constructor Summary
Constructors Constructor Description ForwardingInjectionTarget()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract InjectionTarget<T>delegate()voiddispose(T instance)Destroys the instance.Set<InjectionPoint>getInjectionPoints()Returns the set of allInjectionPoints.voidinject(T instance, CreationalContext<T> ctx)Performs dependency injection upon the given object.voidpostConstruct(T instance)Calls thePostConstructcallback, if it exists, according to the semantics required by the Java EE platform specification.voidpreDestroy(T instance)Calls thePreDestroycallback, if it exists, according to the semantics required by the Jakarta EE platform specification.Tproduce(CreationalContext<T> ctx)Causes an instance to be produced via theProducer.
-
-
-
Method Detail
-
delegate
protected abstract InjectionTarget<T> delegate()
-
inject
public void inject(T instance, CreationalContext<T> ctx)
Description copied from interface:InjectionTargetPerforms dependency injection upon the given object. Performs Jakarta EE component environment injection, sets the value of all injected fields, and calls all initializer methods.
- Specified by:
injectin interfaceInjectionTarget<T>- Parameters:
instance- The instance upon which to perform injectionctx- TheCreationalContextto use for creating new instances
-
postConstruct
public void postConstruct(T instance)
Description copied from interface:InjectionTargetCalls the
PostConstructcallback, if it exists, according to the semantics required by the Java EE platform specification.- Specified by:
postConstructin interfaceInjectionTarget<T>- Parameters:
instance- The instance on which to invoke thePostConstructmethod
-
preDestroy
public void preDestroy(T instance)
Description copied from interface:InjectionTargetCalls the
PreDestroycallback, if it exists, according to the semantics required by the Jakarta EE platform specification.- Specified by:
preDestroyin interfaceInjectionTarget<T>- Parameters:
instance- The instance on which to invoke thePreDestroymethod
-
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>- Parameters:
ctx- TheCreationalContextto use for the produced object- Returns:
- the instance produced
-
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.
-
getInjectionPoints
public Set<InjectionPoint> getInjectionPoints()
Description copied from interface:ProducerReturns the set of all
InjectionPoints. If theProducerrepresents a class, then this returns returns the set ofInjectionPointobjects representing all injected fields, bean constructor parameters and initializer method parameters. For a producer method, this returns the set ofInjectionPointobjects representing all parameters of the producer method.- Specified by:
getInjectionPointsin interfaceProducer<T>- Returns:
- the set of all injection points for the producer
-
-