Is spring application context reloading via ConfigurableApplicationContext refresh() considered bad-practice
We have a Spring application that is hosted on a shared tomcat instance . Sometimes we have to reload the spring application context but don't want to restart the Tomcat server, because other application's are hosted there as well. Is refreshing springs application context via ((ConfigurableApplicationContext)applicationContext).refresh(); considered bad practice ? What alternatives do I have? A few issues that might arise - Firstly, refresh() should destroy all beans currently living in the context (singletons etc) and recreate them, so any bootstrapping that might happen will happen again