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

Martin Kouba (JIRA) issues at jboss.org
Tue Nov 29 07:23:00 EST 2016

     [ https://issues.jboss.org/browse/CDI-595?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Kouba updated CDI-595:
    Fix Version/s: 2.1 (Discussion)

> 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
>             Fix For: 2.1 (Discussion)
> 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

More information about the cdi-dev mailing list