Announcement Announcement Module
No announcement yet.
Refreshing application context automatically Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Refreshing application context automatically

    Is it possible to refresh the application context (such as ClassPathXmlApplicationContext) automatically (non programmatically)? I have several beans that are configured with a PropertyPlaceholderConfigurer, and I want the application context to be reloaded when a properties file is changed, or at specific intervals, thus refreshing the beans with the new configuration.

    I found the discussion below, but it seems that this feature will only be added in version 1.4?

  • #2
    Check out also the article on hot swappable target on spring site (it might useful but it depends on your requirements).


    • #3
      There's no way now to have a context auto-refresh.

      That said, if you are ok with the basic level of control you get via the programmtic APIs, you could yourself set up an external task which does this. You'd need to hook into the lifecycle of the context. One way to do this externally if you are using ContextLoader anyway is to subclass ContextLoader...