title: Spring: how to do transparent runtime changeable property configuration
body: <p>Spring has the nice mechanism <a href="http://static.springsource.org/spring/docs/3.1.x/spring-framework-reference/html/beans.html#beans-factory-placeholderconfigurer" rel="noreferrer">PropertyPlaceholderConfigurer</a> for injecting values like timeouts, JDBC Urls and so forth into Spring beans for configuration purposes. Is there a sensible way to handle configuration values that can change at runtime?</p>
  
  <p>UPDATE: With Spring 3.1 there is a nice way to include non-static configuration sources such as the database via <a href="http://blog.springsource.com/2011/02/15/spring-3-1-m1-unified-property-management/" rel="noreferrer">PropertySource</a>s. Some ApplicationContexts provide a refresh mechanism that is in principle able to handle changing configuration values. However it stops the application first, then creates all beans fresh and then starts the application context again. However, for our purposes I would need a way to do this transparently, such that the server correctly handles currently running requests.</p>
  
  <p>Another idea to do this would be a custom Scope that creates fresh objects when the configuration changes. Unfortunately the ObjectFactory provided to the Scope uses a preprocessed bean definition, such that the placeholders are not read anew from the configuration. Thus the created objects have the same configuration. :-(</p>