[
https://issues.apache.org/jira/browse/OWB-897?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13761237#comment-13761237
]
Mark Struberg commented on OWB-897:
-----------------------------------
InjectionTarget section is really a beast. All the interceptor logic must be
part of the instance created by the Producer<T>#produce (InjectionTarget
extends Producer). But sadly we need some info from 'outside' because a few
params are missing in the SPI.
Will take a look whether we loose something during the wrapping.
> 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
>
> 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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira