Announcement Announcement Module
Collapse
No announcement yet.
Looking for a FactoryBean that returns a list of all beans implementing an interface Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Looking for a FactoryBean that returns a list of all beans implementing an interface

    Hi,

    Looking at the Spring API (2.5.6), I can't find this kind of factory, something that collects all the beans of a given type and returns them as a collection.

    I would like to use it like this:

    <bean class="MyOwnBean">
    <property name="myCollection">
    <bean class="TheFactoryBeanImLookingFor">
    <property name="type" value="my.type.ToLookFor" />
    </bean>
    </property>
    </bean>

    where myCollection is a collection of my.type.ToLookFor.

    In fact, I can code this factory bean on my own, but I would like to know if is exists or not. For information, the code of the factory would be BeanFactoryAware and make a look-up like:

    Collection objectToReturn =
    applicationContext.getBeansOfType(type).values();

    Does someone know if such a factory bean exists by default ?

    Thanks,
    Damien.
Working...
X