tags:

views:

1438

answers:

3

In Log4j, there is a feature wherein the system can be initialized to do a configure and watch with an interval. This allows for the log4j system to reload its properties whenever the property file is changed. Does the spring framework have such a Configuration Observer facility wherein the Configuration is reloaded when it changed. The Configuration that needs reloading is not the Springs's applicationContext.xml but various other configuration files that are initialized using the Spring initialization beans.

+3  A: 

AFAIK Spring does not provide such a utility. However there is a 3rd party tool, JavaRebel that enables you to update an entire web application (including the Spring configuration) without requiring a server restart.

A free trial is available, and the purchase price is fairly inexpensive.

Don
+3  A: 

I found a utility that does something similar to Log4J here. It's basically an extension to PropertyPlaceholderConfigurer that reloads properties when they change.

Phill Sacre
+2  A: 

I would be extra cautious with reloading spring application context.

What do you expect to happen with singleton beans? If an object has a reference to singleton bean, should it be updated?

LiorH
I don not want to reload spring applicationcontext.xml or any of the spring beans already loaded. I will try out the solution Phill Sacre posted.
zkarthik