I’m using properties file with Spring 3.
When Spring initializes its contex it loads the properties file and puts it in all beans with @Value annotation.
I want to have a possibility to update some properties in a file, and expose a JMX on the server that will reload the new properties to Spring – without restarting the server, and reloading its context.
Can I implement this by using some Spring method to reload properties and populate them to all beans, or should I write something like this by my own?
I would suggest replacing the
java.util.Propertieswith aPropertiesConfigurationfrom the Apache Commons Configuration project. It supports automatic reloading, either by detecting when the file changes, or by triggering through JMX.