I am writing a Java server-side application, and I want to provide built in functionality so that the apple can update itself. I want the application to poll a server, and if there are a new version that it can update to, then it should let the user activate the update command.
I would like the following to happen during this update:
- Download a new JAR file with the new version
- Reload the contents of that JAR into the main application
- Unload any old classes from the old JAR
I would like this to happen, ideally, without having the applications PID change during this process.
I believe Jenkins does do this, but I haven't been able to figure out just how they are able to do so.