What's the best approach to use in order to programmatically restart a Spring web app running on Tomcat?
I have two specific scneario's I'm considering:
Installation The user is configuring the system, providing database connection params etc. Once provided, the Spring data contexts are invalid, and I'd like to restart to re-initialize with the correct params.
Updgrading The application has downloaded an update, and needs to self-install. This may involve deploying an updated WAR, and running database upgrades. At this point, it seems like a restart of the app inside tomcat is the best way to go.
What approaches should I be using? I'd like to do this programmatically, so the user doesn't have to log in to the server itself.