[cdi-dev] [JBoss JIRA] (CDI-595) Clarify if it is possible to 'manually' use interceptor

Matej Novotny (JIRA) issues at jboss.org
Fri Apr 1 08:50:00 EDT 2016


Matej Novotny created CDI-595:
---------------------------------

             Summary: Clarify if it is possible to 'manually' use interceptor
                 Key: CDI-595
                 URL: https://issues.jboss.org/browse/CDI-595
             Project: CDI Specification Issues
          Issue Type: Bug
          Components: Interceptors
    Affects Versions: 2.0-EDR1
            Reporter: Matej Novotny


This issue was inspired by Deltapike issue ([DELTASPIKE-1060|https://issues.apache.org/jira/browse/DELTASPIKE-1060] and [DELTASPIKE-1108|https://issues.apache.org/jira/browse/DELTASPIKE-1108]).

In the DS issue, the interceptor instance is created with {{new CreationalContext}} and injects an {{@Intercepted Bean}}.
Later on, there is an attempt to manually call {{javax.enterprise.inject.spi.Interceptor.intercept(InterceptionType, T, InvocationContext)}}.
This (obviously) fails, as the interceptor does not have a context (meaning a link to the bean it is supposed to intercept).

Quoting the interceptors spec: "The lifecycle of an interceptor instance is the same as that of the target class instance with which it is associated."

Therefore we might want to clarify whether creating interceptors in this way is valid at all.



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


More information about the cdi-dev mailing list