I am using Spring 2.0 on JDK6.
What problems could be caused by refreshing a context
in a bean that was created by the context? That is,
bean X was created by a web application context C
and bean X chooses to do the following:
If the refresh method of X is invoked, what would be the state of the beanCode:class X implements ApplicationContextAware { private ConfigurableApplicationContext ctx; public void setApplicationContext(final ApplicationContext ctx) { this.ctx = (ConfigurableApplicationContext) ctx; } //... public void refresh() { if (ctx != null) { ctx.refresh(); getLogger().log("Reloaded the application..."); } }
after ctx.refresh() is invoked? Let's assume that there are no
requests being serviced.
Is this is a correct way of refreshing the context?
Regards,
/U


Reply With Quote