Results 1 to 2 of 2

Thread: Binding BeanFactoryPostProcessors to a single bean factory

  1. #1
    Join Date
    May 2006
    Posts
    18

    Default 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. #2
    Join Date
    Aug 2004
    Location
    Montréal, Canada
    Posts
    845

    Default

    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.
    Omar Irbouh

    Spring Modules Team
    http://irbouh.blogspot.com/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •