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

Clarify InterceptionFactory.ignoreFinalMethods() purpose and functioning

    Details

    • Type: Clarification
    • Status: Resolved (View Workflow)
    • Priority: Critical
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 2.0 .Final
    • Component/s: None
    • Labels:
      None

      Description

      It should be clear that InterceptionFactory.ignoreFinalMethods() only affects the generation of the "proxy" which enables interception. E.g. the following example would FAIL during validation of myFoo injection point (bootstrap):

       @Inject
       Foo myFoo;
      
       @Produces
       @RequestScoped // -> Requires a client proxy
       public Foo produce(InterceptionFactory<Foo> interceptionFactory) {
              // Suppose Foo has a final method
              return interceptionFactory.ignoreFinalMethods().createInterceptedInstance(new Foo());
        }
      

      The reason is that the CDI container must treat the producer as a deployment problem (unless javax.enterprise.inject.spi.ProcessBeanAttributes.ignoreFinalMethods() is used for the producer method).

      I understand that it's not very intuitive. On the other hand, these are two different concepts. I.e. the injection point validation happens during bootstrap while the InterceptionFactory is used at runtime.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                antoinesabot-durand Antoine Sabot-Durand
                Reporter:
                mkouba Martin Kouba
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: