Interface InjectionServices
- All Superinterfaces:
Service
InjectionContext.getAnnotatedType() gives access to the modified state of the type.
InjectionServices is a per-BeanDeploymentArchive service.- Author:
- Pete Muir, Jozef Hartinger
-
Method Summary
Modifier and TypeMethodDescription<T> voidaroundInject(InjectionContext<T> injectionContext) Callback for injection.<T> voidregisterInjectionTarget(jakarta.enterprise.inject.spi.InjectionTarget<T> injectionTarget, jakarta.enterprise.inject.spi.AnnotatedType<T> annotatedType) This method is invoked during Weld bootstrap and allows an integrator to process anInjectionTargetthat may be injected at runtime.
-
Method Details
-
aroundInject
Callback for injection. CallInjectionContext.proceed()to cause CDI-style injection to occur.- Type Parameters:
T- the type of the injected instance- Parameters:
injectionContext- the context in which injection occurs
-
registerInjectionTarget
<T> void registerInjectionTarget(jakarta.enterprise.inject.spi.InjectionTarget<T> injectionTarget, jakarta.enterprise.inject.spi.AnnotatedType<T> annotatedType) This method is invoked during Weld bootstrap and allows an integrator to process an
InjectionTargetthat may be injected at runtime. The implementation may want to read the metadata on resource injection point and cache it so that it does not need to repeat metadata parsing on eacharoundInject(InjectionContext)invocation.Furthermore, the integrator is responsible for validating resource injection points (as defined in CDI 1.1 3.7.1).
For each resource injection of a type:
- @Resource
- @PersistenceContext
- @PersistenceUnit
- @EJB injection
- @WebServiceRef
the implementation must validate the type of the injection point. If the injection point type differs from the type of the matching object in the Java EE component environment, the implementation throws
DefinitionException.Note that this method may be called at runtime if the application uses an
InjectionTargetFactoryto create injection target instances at runtime.- Type Parameters:
T- the type of the injected instance- Parameters:
injectionTarget- the injection target to be processedannotatedType- theAnnotatedTypemetadata for the given injection target
-