[Openjnlp-devel] Updated Launcher and caching
Brought to you by:
kherr
From: Kevin H. <ke...@na...> - 2002-05-27 02:02:55
|
I meant to post this info a few days ago... OpenJNLP has been tweaked with a much improved self-updating launcher. Here's a breakdown of what's new: FileCachedResource is no longer an inner class, and can be used directly without anything else. The constructor simply needs a Reference and a directory (File object) to store the resource in. You can also supply a separate directory for the place to expand native libs. If the lib dir is null no expansion will be done. CachedResource.update() is now public and can be called at any time to update the resource in the cache. The external launcher now only checks to update itself once. The check for an update is done from Launcher.launchExternal() which still always calls Launcher.updateLauncher(), but updateLauncher() will only do the update once. updateLauncher() tries to update the launcher jars from the installed application itself, based on where the jars are supposed to be (from the launcher.properties file). If that location can't be accessed then updateLauncher() will use the launcher network home for the jars. This is set in launcher.properties to <http://openjnlp.nanode.org/launcher>. I've got nearly-current files out there so network updating is functional. The updating is done using the new FileCachedResource for each launcher jar. There were a number of problems I found in the original CachedResource.update() code which have been fixed. In addition to this FileCachedResource.update() will also use File.setLastModified() to set the last modified date of the cache file to whatever the date on the source (server side) is. I also had to tweak CachedResource.getRemoteLastModified() for special checking of file URLs because Sun's "file:" URLStreamHandler is poorly implemented. Finally, the build process now combines all of the xml-related jars into a single "openjnlp-extra.jar". The purpose of this is to avoid weird version naming issues that might arise (such as with NanoXML, for example). The idea behind "openjnlp-extra.jar" is it will contain any third-party code that the launcher needs. The ant build uses the <jlink> task to combine jars, which is part of the ant optional tasks jar, so make sure and have those installed if building with ant. |