Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-15217

bean(Bean.class) should lookup the registry by type

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.3.0
    • Fix Version/s: 3.5.0
    • Component/s: came-core
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      While .bean("beanName") does lookup into the registry, .bean(Bean.class) does not and directly instantiates the provided class.

      It would be more consistent to have it looking into the registry and return a bean reference if only one bean of the provided class is resolved. If the resolution is ambiguous or no beans match, an exception should be thrown.

      This is also applicable to all .bean(Class, ...) methods.

        Attachments

          Activity

            People

            • Assignee:
              davsclaus Claus Ibsen
              Reporter:
              antonin.stefanutti Antonin Stefanutti
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: