Java – how to reload properties using spring?
•
Java
I am using the properties file of spring 3
I want to have a possibility to update some properties in the 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 do this by using some spring methods to reload properties and populate all beans, or should I write such things in my own way?
Solution
I recommend replacing java.com with propertiesconfiguration from the Apache commons configuration project util. Properties. It supports automatic reload by detecting when files change or triggered by JMX
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码