[cdi-dev] [JBoss JIRA] (CDI-598) Clarify what happens if one of the interceptors in the AroundConstruct chain does not invoke InvocationContext.proceed()

Martin Kouba (JIRA) issues at jboss.org
Mon Apr 11 08:52:00 EDT 2016


Martin Kouba created CDI-598:
--------------------------------

             Summary: Clarify what happens if one of the interceptors in the AroundConstruct chain does not invoke InvocationContext.proceed()
                 Key: CDI-598
                 URL: https://issues.jboss.org/browse/CDI-598
             Project: CDI Specification Issues
          Issue Type: Clarification
          Components: Interceptors
    Affects Versions: 1.2.Final
            Reporter: Martin Kouba


The interceptors spec only states (2.2 Interceptor Life Cycle):
{quote}
If the InvocationContext.proceed method is not invoked by an interceptor method, *the target instance will not be created*.
{quote}
But it's not clear what does it mean in the context of CDI.

Possible interpretations are:
* {{Contextual.create()}} returns null
* an exception (e.g. {{javax.enterprise.inject.CreationException}}) is thrown

I think the exception is more appropriate. Note that right now only @Dependent producer methods are allowed to return a null value.

By the way, the RI (Weld) currently returns null because there is a TCK test which requires this behavior. I'm going to create a separate TCK issue so that the test is redesigned.



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the cdi-dev mailing list