The road less taken

« Ask Guruji: The... | Main | Packaging your updat... »
Friday Jun 15, 2007

Creating your own update center addon module

To try GlassFish Update Center, install GlassFish V2 (screencast). Then go to install-root/glassfish/updatecenter/bin and invoke updatetool (or updatetool.bat). You'll see a list of addon modules available for installation.

But what's an addon?

An addon is a companion product or runtime component installed on top of Sun Java System Application Server.

Right, but how do you create such a module?

To start with, you need to implement an com.sun.appserv.addons.Installer interface. You may also need a com.sun.appserv.addons.Configurator interface implementation.

What's the difference between and installer and a configurator plugin?

If addon requires installation of shared files which are not specific to a particular application server domain, installation and initial configuration of such files must be handled by installer plugin. The installer plugin has read-write access to installation root directory (INSTALL_ROOT) of the appserver. Installer plugin is invoked either at the end of appserver installation or when the CLI command asadmin install-addon addon_name_installer.jar is executed.
The configurator plugin should assume read-only access to INSTALL_ROOT and read-write access to root directory of the domain (DOMAIN_DIR). The configurator will be invoked once, prior to starting application server domain. The configurator will access application server configuration files like DOMAIN_DIR/config/domain.xml, DOMAIN_DIR/config/server.policy etc. and make necessary changes.

Where can I get the installer plugin API?

From Maven

How do I package the installer plugin?

addon_name_installer.jar
        |- META-INF/services/com.sun.appserv.addons.Installer
        |- InstallerImpl.class (implements Installer)
        |- InstallerUtil.class
        |- InstallerMore.class
        |- addon_name_configurator_01_01_00.jar
           |- META-INF/services/com.sun.appserv.addons.Configurator
           |- ConfiguratorImpl.class (implements Configurator)
           |- Another.class
           |- More.class
           |- Util.class 

How do I invoke and test the installer plugin?

Installer plugin is invoked either at the end of appserver installation or when the CLI command

asadmin install-addon addon_name_installer.jar 

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed