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

Allow to recognize custom Bean at runtime

    Details

    • Type: Feature Request
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.0 .Final
    • Fix Version/s: 2.1 (Discussion)
    • Component/s: Beans
    • Labels:
      None

      Description

      At the moment, they only way to tell custom bean (created via BeanConfigurator or class implementing javax.enterprise.inject.spi.Bean) from "standard" one is to have an extension and listen to ProcessSyntheticBean. This is good enough if it's sufficient to tell the difference at bootstrap time.

      However, at runtime, there is no way to do this.
      We could add a method to javax.enterprise.inject.spi.Bean which would allow to tell the difference. The name of the method could be isCustom() or getKind().

      Generally, there should be no need to differentiate between custom/standard beans, but when digging deeper, it doesn't hurt to know. Putting this into Bean interface keeps it deep enough while still giving the information.
      One of the use cases for this would be CDI-194, which could be "nicely" implemented (avoiding null values), if there was a way to recognize custom bean.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated: