/home/projects/magnet/reference/core/launcherHandlerDef

launcherHandlerDef

Overview

The <launchHandlerDef> element can be used to extend the functionality of Magnet by adding a new launcher to start a different type of process. For example, if you want to support starting a Python program from Magnet you would first need to implement the LaunchHandlerIF interface. Your class would manage the Python runtime within the contract of that interface. Once this class is coded you need to tell Magnet how to associate the new Python launcher to the class you just wrote. To perform the association between the launcher and the class you create a launcher handler definition.

Attributes

The following list the xml attributes of the <launchHandlerDef> element:

Name Description Required Interpolation
type Defines the type of launcher for which we provide a handler. yes yes
classname The name of the class that implements the LaucnherHandlerIF interface. yes yes

Rendering Operations

When a <launchHandlerDef> element is rendered, it performs the following operations in order:

  1. Resolves the type and classname attributes (using variable interpolation).
  2. Registers the launcher handler with Magnet's internals.

Examples

This example creates a new launcher handler to start python programs. The association defines that the class com.mycorp.magnet.PythonLauncher will be used everytime the "python" launcher type is used.

<magnet xmlns:magnet="http://schemas.sapia-oss.org/magnet/"
        name="LauncherHandlerDefExample1"
        description="This is a first example.">
...
    <launcherHandlerDef type="python" classname="com.mycorp.magnet.PythonLauncher" />
...
</magnet>