You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by "Jean-Louis Monteiro (Jira)" <ji...@apache.org> on 2023/02/14 10:21:00 UTC

[jira] [Created] (OWB-1425) Interceptors not being called on UnmanagedInstance

Jean-Louis Monteiro created OWB-1425:
----------------------------------------

             Summary: Interceptors not being called on UnmanagedInstance
                 Key: OWB-1425
                 URL: https://issues.apache.org/jira/browse/OWB-1425
             Project: OpenWebBeans
          Issue Type: Bug
          Components: Core, TCK
            Reporter: Jean-Louis Monteiro
             Fix For: 4.0.0


OWB does not interceptors on UnmanagedInstance even though the specification is quite clear in that area.

 

https://jakarta.ee/specifications/cdi/4.0/jakarta-cdi-spec-4.0.html#biz_method_full
{quote}When the application invokes:
 * a method of a bean via a contextual reference to the bean, as defined in [Contextual reference for a bean|https://jakarta.ee/specifications/cdi/4.0/jakarta-cdi-spec-4.0.html#contextual_reference],

 * a method of a bean via a non-contextual reference to the bean, if the instance was created by the container (e.g. using {{InjectionTarget.produce()}} or {{{}*UnmanagedInstance.produce()*{}}}, or

 * a method of a bean via a non-contextual reference to the bean, if the instance was enhanced with the {{InterceptionFactory}} interface as defined in [The {{InterceptionFactory}} interface|https://jakarta.ee/specifications/cdi/4.0/jakarta-cdi-spec-4.0.html#interception_factory],
the invocation is treated as a {_}business method invocation{_}.
{quote}
The spec also says
{quote}A method invocation passes through method interceptors and decorators if, and only if, it is a business method invocation.
Otherwise, the invocation is treated as a normal Java method call and is not intercepted by the container.
{quote}
 

We can't pass the following TCK test org.jboss.cdi.tck.tests.full.extensions.beanManager.unmanaged.UnmanagedInstanceTest

 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)