Altio Blog » Using Java 6 Update 10 features in AltioLive

Using Java 6 Update 10 features in AltioLive

Filed under: Developers | June 25, 2008 Jim Crossley @ 11:29

Sun is due to release a major update to the Java 6 SE next month. Called Java 6 Update 10 this involves a rewrite of the Java plugin used by browsers to host applets in web pages, and so this obviously affects AltioLive. Many of the benefits of the new plugin, such as faster startup time and running in a separate process to the browser, will be inherited by any applet that runs in the new plugin, but others require that applets make use of JNLP descriptors in order to use the new features.

JNLP files are used by Java WebStart applications to describe the deployment requirements of an application, and converting an Applet to use a JNLP file is usually straightforward. With JNLP files Applets can now use the following Java 6 Update 10 features:

  • Specifying an applet gets its own JVM instances, rather than sharing the same one with all other applets in the browser.
  • Specifying the heap size (available memory) that the applet can use. Java defaults to 64MB, which can be very limiting for large applets or when multiple applets are running.
  • Specifying a particular version of Java to be used to run the applet. Previously the applet ran with whatever the default Java version the user had installed.
  • Take advantage of new features, such as being able to drag an applet out of the browser onto the desktop.
  • Allow unsigned applets to directly communicate with domains other than the one they were downloaded from, as long as the domain allows it.

You can see full details of the features in Java 6 Update 10 here https://jdk6.dev.java.net/plugin2/

As you can see, Update 10 addresses many of the problems that people can experience when deploying applets, and adds some new features that bring applets up to date with other web technologies. One of the most useful features for enterprise applications written in Altio is the ability to deploy with more than the default memory size - previously each user had to manually edit their Java settings in the Control Panel, and now developers can specify different settings for different applications. Each AltioLive applet launched with a non-standard heap size will automatically run in its own JVM, so it also isolates an AltioLive application from any other applets in the users browser.

These new features are currently being incorporates into the latest AltioLive development code, but if you want to start using them as soon as Java 6 Update 10 is available then you can do so quite easily. All that you need to do is download 2 files:

  • altioClient.js - This is an update to the standard Altio client JavaScript file used to construct applet parameters dynamically.
  • getJNLP.jsp - This is a new file that dynamically generates a JNLP file for an AltioLive application. We need this, rather than a static JNLP file, because of the number of dynamic parameters used when configuring the AltioLive applet to launch an application.

These file can be downloaded from here: http://developers.altio.com/developer/downloads/altio-Java6Update10files.zip

Simply copy these two files into your Altio context (e.g. <altio>/tomcat/webapps/altio52). Once that is done, to enable the new features for an individual AltioLive application you need to add the line:

var useJNLP = true;

into the htmltemplate.txt file for that application. Once that is set then the altioClient.js will pick up that setting and use the new plugin features.

These files are very early technology previews, for testing new features, and are not intended to be used on production systems. In particular, getJNLP.jsp does not provide support for all of the dynamic features that are currently supported - so custom control JAR files need to be added manually to that file in order for it to load them. However the basics are there, and if all that you want is to try out AltioLive applications in separate JVMs with extra memory then they will do that.

We will post more information and updates as we progress with the incorporation of Update 10 features into the core AltioLive product.


No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

Show/Hide All
    Follow us on Twitter