Uploaded image for project: 'CDI Specification Issues'
  1. CDI Specification Issues
  2. CDI-595

Clarify if it is possible to 'manually' use interceptor

    XMLWordPrintable

Details

    • Bug
    • Resolution: Obsolete
    • Major
    • 2.1 (Discussion)
    • 2.0-EDR1
    • Interceptors
    • None

    Description

      This issue was inspired by Deltapike issue (DELTASPIKE-1060 and 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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            manovotn Matěj Novotný
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: