Using the GlassFish Update Center to reach out to thousands of developers

The GlassFish Update Center is a tool that lets you deploy extra features, libraries, or even applications to an existing installation in a very user-friendly fashion. It is part of every copy of GlassFish, Sun Java System Application Server and the Java EE 5 SDK (3.5M+ downloads). The following describes the simplest GlassFish Update Center module who’s only job is to deploy a self-contained web application (no database dependency in particular).

To follow-up on a previous post, I’ll use XWiki which has since hit version 1.0 with 1.1.1 being the latest. I’ve tweaked their WAR distribution to use HSQL (as already described in the previous post) so that it has no dependency on external resources. Making this XWiki distribution available via the GlassFish Update Center requires 2 easy steps:

1/ Package the WAR artifact into a module file (default extension is .nbm but anything can be used as it is really only a ZIP file) with info/info.xml and module/xwiki.war as the only two entries. I’ve actually called the file xwiki.gfz for no particular reason and posted it here.

2/ Author an Update Center catalog file compliant with this DTD describing the module – download size, module author, license, short/long description, etc… This XML file is the only server-side component needed. I’ve created and posted the file here (so you can try it). The key line here is :

which basically tells the update center that the module is a Java EE artifact (WAR, EAR, RAR) which will cause the updater to copy it to GlassFish’s autodeploy directory. Other valid values for Module-Type are ADDON_INSTALLER, ADDON_CONFIGURATOR, and ARCHIVE.

The user experience then looks like this :

•  Start the Update Center client located in GLASSFISH_INSTALL/updatecenter/bin.

•  Install the update after agreeing to the license (download, unpack and install all happens under the cover)

•  Launch the application (no restart)

Steps are illustrated on this other page

This is an easy way for the many web applications out there to be easily made available to the large number of people downloading GlassFish. Of course not every application is self-contained like the one I used and in that case you would have to use a custom installer and configurator as explained by Manveen here and here. It allows for the Update Center to install bits (libraries, config files, …), modify existing file (i.e. domain.xml) and create the appropriate resources in the application server (connection pools for instance).

Interested in packaging your application for the GlassFish Update Center? Try this out and post comments here!

Author: alexismp

Google Developer Relations in Paris.

3 thoughts on “Using the GlassFish Update Center to reach out to thousands of developers”

Comments are closed.