Announcement Announcement Module
Collapse
No announcement yet.
PropertyOverrideConfigurer lifecycle? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • PropertyOverrideConfigurer lifecycle?

    i've got a library that includes a spring config file. users of the library are expected to "import" the included spring config file that's shipped with the jar of my library.

    What i'm trying to do is determine if the clients that are importing my spring config file have a specific property file in the classpath.

    If it's there, i'd like to apply that to a PropertyOverrideConfigurer.

    Is there a way to tell if that file exists, and if so, when the PropOverrideConfig will apply it to the beans defined in the library's configuration file?

    thanks

  • #2
    Any chance you could just clarify what you are trying to do? I think I was nearly there, but I could do with a little more.

    Comment


    • #3
      trying to determine when a propertyOverrideConfigurer applies it's properties it gets from a property file, then trigger an event immediately after that.

      Comment


      • #4
        The PropertyOverrideConfigurer is a BeanFactoryPostProcessor. So as soon as the BeanFactory (applicationcontext) is being constructed this one kicks in.

        However isn't it enough to specify the ignoreResourceNotFound (set it to true). If a property file isn't found it fails silenty and properties aren't going to be replaced, if the file is there it gets loaded and will be used to override properties.

        Comment

        Working...
        X