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

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

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.3.0
    • 3.5.0
    • came-core
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: