Skip to main content

Continue download of Applet and WebStart in background

3 replies [Last post]
agoubard
Offline
Joined: 2003-10-04

One of the new feature of the consumer JRE will be the possibility to run an application even if you don't have at the start-up time all the classes available.

Wouldn't it be nice to have this feature for applets and webstart applications?

What does that means:

  • You need to specify multiple jar in the archive argument of the applet.
  • The code is executed as soon as the Jar containing classes is available.

Benefits:

  • Much smaller download -> faster start-up
  • Possibility to include more libraries
  • No new API or changes to the language needed

What can it be used for:

  • Have a small applet displaying a custom wait for loading and then execute the application
  • Use libraries that most of the time are not needed at start-up time such as JavaHelp, look and feels,
    Ant, commons-http, commons-network, BeanShell, SVG libraries, Flying saucer
  • Show the game options and choose level while downloading Java 3D or Java FX.
  • Have options, print preview, codec, plug-ins downloaded in background

All these libraries are quite likely excluded from applets because of their download size.

What are the challenges:

  • Class.getResource() and Class.getResourceAsStream() especially with ResourceBundle when the resource is not found.
  • Change the Applet/WebStart classloader to use this new feature
  • Get it in the Consumer JRE
  • Signed applet suddenly calling an unsigned library

Would you like me to write an RFE for this?

Best regards,
Anthony

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
kbr
Offline
Joined: 2003-06-16

Agreed; this is basically already supported.

See the Java Web Start Developer's Guide:
http://java.sun.com/javase/6/docs/technotes/guides/javaws/developersguid...

and the JNLP specification:
http://java.sun.com/products/javawebstart/download-spec.html

in particular denoting parts as "lazy".

The new Java Plug-In is going to support launching applets from JNLP files in a forthcoming build, which means that you will be able to mark various jars and extensions as lazily downloaded. This is a more powerful mechanism than those available in the archive parameter in the applet tag (which, by the way, also supports a form of lazy downloading). I think we will be able to cover all of your use cases using the JNLP support in the new Java Plug-In combined with the JNLP DownloadService, which will be supported for applets as well.

linuxhippy
Offline
Joined: 2004-01-07

The only drawback for the current implementation is that the update-download/check is not lazy:

If you have an application with 1 eager jars and 9 lazy and all 9 lazy jars have been downloaded lazily before, if you update all 9, at startup Webstart will check for updates and will update all of them.
I already signed a bug-report because in general it makes the whole lazy-downloading thing a bit obsolete as soon as you start deploying updates.

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6510995

lg Clemens

linuxhippy
Offline
Joined: 2004-01-07

This is already possible, since java 1.3 ^^
Search for "indexed jars" should help.

lg Clemens