I'm new to Wicket and would like to maintain a web application from inside itself using some sort of maintenance admin page for running clean-up, DB updates, recovery and so on. Since I plan to use Hibernate or similar for data binding I would like to trigger a complete reboot of the application from inside itself without giving everybody who will be able to run these actions the accompanying Tomcat manager password.
As far as I found out, there does not seem to be an easy way to trigger a real restart of a Java web application without the manager password? However, since there are many Java webapps having such restart functionality in their admin panels, I assume it should be possible to trigger a restart in either specific servlet containers or some web frameworks. They somehow have to do the trick? (or maybe they don't really restart from scratch but just reinitialize without a clean restart?)
I could not find anything about Wicket or Tomcat being able to be triggered with a shutdown and restart from their applications although there are some internal methods in Wicket that might be able to do that? (can be accessed publically but JavaDoc advises against it since they are only for internal use)
From a security point of view I don't really see why an application should not be able to request such a restart from its own code.
Can this be done and if yes, what will I have to do in my application to have it restarted?
Edit: Just to make my question more precise: Neither the user nor the app should have any password that could be used to access the Tomcat manager interface. I was thinking of some method to call or some flag to set to have the servlet container be triggered to restart that particular application without the need of authorization to do so. My thoughts are that since the application is running in a servlet container it should have some way to shutdown and be restarted. If that's not possible in general with Java app servers, there may be some way to do it on application level by doing a call to the underlaying framework (Wicket in this case) to end all running threads, clean up as much as possible and restart the application using the framework; something like a "soft reboot" of the app stack.