Reloadable properties in Spring beans (Java 1.5)

610 views Asked by At

I would like to reload the Spring bean properties at runtime so that I don't have to restart the web application to reset the properties.

For example the web-service client endpoint can be changed at runtime without restart, or the injected properties through XML configuration or annotations.

I saw this link and would like to do the same using Java 1.5.

I am not looking for complete code but some kind of guidance.

1

There are 1 answers

0
kevin847 On

I've seen jpathwatch used to achieve something similar, and this works with Java 5. It allows you to poll for file or directory changes at an interval, e.g. every second.

If the URI of your webservice endpoint was externalised to a configuration file, you could setup jpathwatch to monitor that configuration file, and when it has changed, re-create your web-service using the new configuration value.

I'm not exactly sure how it could be used to reload spring beans, through it's probably possible.

Website: http://jpathwatch.wordpress.com/