Magnet Reference

Overview

This reference provides technical information about the different elements of Magnet. Each element is described in detail, with examples. This reference first describes the core elements of Magnet. The sections that follow discuss the two extensions that are provided with the Magnet distribution: the Java extension, that allows starting Java applications; and the system extension, that allows to starting native processes.

All the Magnet elements must be associated to the following XML namespace: http://schemas.sapia-oss.org/magnet/core/. The usage of a namespace prefix is up to the user, as long as it follows the rules defined by the XML namespace definition.

Magnet DTD

Magnet comes with a DTD to validate your XML configuration file, and/ot to have auto-completion of element and attribute names in your favorite IDE. The following DOCTYPE needs to be define in your XML file in order to include it:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE magnet PUBLIC "-//SAPIA OSS//Magnet DTD 2.0//EN"
                 "http://www.sapia-oss.org/dtd/magnet-2.1.dtd">

Core Elements

  • magnet

    Main element of a magnet configuration file.

  • parameters

    Defines a group of parameters that can be used for variable interpolation.

  • param

    Defines a parameter (name-value pair) that can be used in variable interpolation.

  • scriptHandlerDef

    Defines a scripting engine to use within Magnet.

  • script

    Executes a script when running a Magnet file.

  • protocolHandlerDef

    Allows specifying a custom protocol to load resources into Magnet.

  • path

    Defines a group of resources using path elements.

  • launcherHandlerDef

    Allows specifying a custom launcher type in Magnet.

Java Elements

  • codebase

    Provides an easy way to define the java.rmi.server.codebase system property using path elements.

  • classpath

    Defines the complete classpath of a Java application to start.

  • launcher

    Defines how to start a Java application by calling a main method on a class.

  • profile

    Defines the parameter set corresponding to a specific profile.

System Elements

  • environment

    Defines a group of environment variables to be exported into a system process.

  • variable

    Define a single name-value pair environment variable.

  • launcher

    Define how to execute a system process by calling a command.

  • profile

    Defines the parameter set corresponding to a specific profile.