You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by "Arne Limburg (JIRA)" <ji...@apache.org> on 2013/12/03 14:58:36 UTC
[jira] [Reopened] (OWB-897) Interceptors do not work on processed
injection targets
[ https://issues.apache.org/jira/browse/OWB-897?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Arne Limburg reopened OWB-897:
------------------------------
This fix is wrong!
The Producer/InjectionTarget is responsible for applying the Interceptors and Decorators (see CDI 1.1 Spec, 11.2)
So, if someone applies a custom Producer/InjectionTarget, he is responsible for applying Interceptors and Decorators.
> Interceptors do not work on processed injection targets
> -------------------------------------------------------
>
> Key: OWB-897
> URL: https://issues.apache.org/jira/browse/OWB-897
> Project: OpenWebBeans
> Issue Type: Bug
> Components: Interceptor and Decorators
> Affects Versions: 1.2.0
> Reporter: Harald Wellmann
> Assignee: Romain Manni-Bucau
> Fix For: 1.2.1
>
>
> I have a portable extension which processes injection targets and replaces them with a custom implementation of javax.enterprise.inject.spi.InjectionTarget.
> This breaks interceptors on beans injected into beans which are processed injection targets. The injected contextual references are missing the expected proxy.
> The following code snippets look suspicious:
> org.apache.webbeans.component.InjectionTargetBean.defineBeanInterceptorStack():
> if (this instanceof InterceptedMarker && getInjectionTarget() instanceof InjectionTargetImpl) { ... }
> .
> This means that interceptors only get processed if the injection target is an instance of InjectionTargetImpl, which does not cover the case of a custom injection target provided by a portable extension.
> org.apache.webbeans.container.InjectionTargetFactoryImpl.createInjectionTarget(Bean<T>):
> This method directly returns the injection target processed by the extension. This target should probably be wrapped by OWB's own implementation to make interceptors work.
--
This message was sent by Atlassian JIRA
(v6.1#6144)