Announcement Announcement Module
Collapse
No announcement yet.
Binding BeanFactoryPostProcessors to a single bean factory Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Binding BeanFactoryPostProcessors to a single bean factory

    Hi,

    im loading my application context using the ContextLoaderListener. The application context is combined by several seperated bean definition xmls.

    All bean definition files contain a PropertyPlaceHolderConfigurer (BeanFactoryPostProcessor) with different property sources.

    It seems loading the whole application context using the listener executes all configurers in sequence on all loaded xml files (so to say the whole application context).

    What i need to do is, to bind a specific BeanFactoryPostProcessor only the the bean definition xml it is contained in.

    Does anyone have a simple solution for such a problem. And furthermore do you think it would be a nice feature to have in future releases of the spring-framework ?

    greets
    Sebastian

  • #2
    Sebastian,

    BeanFactoryPostProcessor are applied to the BeanFactory rather than the containing xml file.

    I can think of two solutions to work arround this:
    - refactor out your configuration into a parent - children factories and have BFPPs defined in the children files.
    - inject the names of the beans to be processed into the BFPP implementation and add a test in postProcessBeanFactory.

    HTH.

    Comment

    Working...
    X