|
From: Jacques B. <jac...@gm...> - 2003-12-09 07:07:24
|
Hi there Leif. I have managed to come right with writing a bootstrap class that first copies the update if there is one and then starts up the main app. It works beautifully. Thanx for the suggestion. This is probably the wrong place to be asking, but do you know if it is possible to unload the main app again without terminating the VM. I.e.The bootstrap class must still be loaded. What happens now, when using the wrapper: The app downloads the new jar, puts it in Updates folder, and signals for the wrapper to restart the VM. Wrapper restarts the VM starting with the bootstrap class, that then copies the update and starts up the app. But now I would love to have the same functionality even when the wrapper isn't used. I.e. The app, that was loaded with the bootstrap, downloads the new jar, and then some how indicates to the bootstrat that there is an update. The bootstrap unloads the app, removing the VM's lock on the file, copies the update, and starts the app up once more. Do you know if this is possible? Thanx for your help. Jacques ----- Original Message ----- From: "Leif Mortenson" <le...@ta...> To: <wra...@li...> Sent: Monday, December 01, 2003 3:07 PM Subject: Re: [Wrapper-user] Restart VM : Jacques, : In that case, you may have to play with class loaders. You will : have a bootstrap : class whose job is to look in a upgrade directory when it first starts. : If there are any new : jars, they are moved into the current jars dir. The bootstrap class : then actually calls the : real main method of your application. : : I don't think the jars will be locked until after they are actually : accessed. So as long as : your bootstrap class is in its own stable and independent jar then this : should work. If not : then you will have to have your bootstrap class create a new class : loader, which in turn : builds up a classpath and so on. Classloaders can be a bit of a pain, : so hopefully the first : option will work. : : Be sure to post back with the results. : : Cheers, : Leif : : Jacques Bosch wrote: : : >Leif. The app is deployed with the Sun JVM and it also locks the jars. So my : >problem is that I cannot replace the old jar file with the new one while the : >VM is still running. : > : > : : : : : ------------------------------------------------------- : This SF.net email is sponsored by: SF.net Giveback Program. : Does SourceForge.net help you be more productive? Does it : help you create better code? SHARE THE LOVE, and help us help : YOU! Click Here: http://sourceforge.net/donate/ : _______________________________________________ : Wrapper-user mailing list : Wra...@li... : https://lists.sourceforge.net/lists/listinfo/wrapper-user : : : |