I think that it would be far simpler to do this with a separate virtual machine and a wrapper script.
Your problem at step 5 is that it requires the application to "shut down" without calling System.exit
and without running the shutdown hooks:
This could require major re-engineering of your application code-base.
Even after you've done that, you still have the problem that old application state is likely to "linger" via objects loaded using the old classloader. Getting rid of that could be really difficult. And if you don't then:
- you've got a permgen leakage,
- you may have a non-permgen memory leaks (e.g. via statics in classes that have been replaced), and
- you may have leakage of application state that could cause problems for the "relaunched" application.