Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-12147

Add generics / parameterized type support to ListableBeanFactory getBeanNamesForType/getBeansOfType methods

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: 4.0.6, 4.1 RC2
    • Fix Version/s: 4.2 RC1
    • Component/s: None
    • Labels:
    • Last commented by a User:
      true

      Description

      Spring currently doesn't have a public API for finding beans based on generics type information. Generic types seem to only be supported in autowiring fields or methods (Spring blog article).

      There is a discussion about this feature in the issue comments of SPR-9965 .

      I'd like to have generics support in ListableBeanFactory:

      String[] getBeanNamesForType(ResolvableType resolvableType);
      <T> Map<String, T> getBeansOfType(Class<T> type, ResolvableType resolvableType) throws BeansException;
      <T> Map<String, T> getBeansOfType(Class<T> type, ResolvableType resolvableType, boolean includeNonSingletons, boolean allowEagerInit) throws BeansException;
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              juergen.hoeller Juergen Hoeller
              Reporter:
              lhotari Lari Hotari
              Last updater:
              Spring Issues Spring Issues
              Votes:
              0 Vote for this issue
              Watchers:
              11 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                3 years, 24 weeks, 5 days ago