Creating the launch descriptor

Once our application is compiled we need to create a launch descriptor, which is an XML file that allows us to launch the application onto a remote node. We use the jtrixmaker tool:


% jtrixmaker -type beatrix -outfile skeleton-launcher.xml \
     -x500dn o=jtrix,cn=skeleton2 -jardirs /home/nik/build/bin \
     -jars skeleton2.jar beatrix.jar libjtrix.jar jaxp.jar parser.jar \
         facets1.jar \
     -access ap \
     -codebase ap skeleton2.jar beatrix.jar libjtrix.jar facets1.jar \
     -plugins org.jtrix.project.skeleton2.plugins.LifeCyclePlugin
% 

The parameters are detailed more in Appendix [*], but meanwhile we have this:

-type
What type of thing we're making. In this case a launcher descriptor for a Beatrix application.
-outfile
What the resulting file is to be called.
-x500dn
AnX.500 distinguished name for the application. Any string such as name1=value,name2=value2,... is suitable. Here, O is Organisation, CN is canonical name. See Section [*] on X.500 names.
-jardirs
What directories jtrixmaker should look in to find the required JARs. Our main Jtrix JARs and skeleton2.jar are all in /usr/lib/jtrix (this might be different on your system) so we name that. We can specify several JARs here if needed.
-jars
A series of whichever JAR files the application will need in order to run. In this case they are: skeleton2.jar, beatrix.jar and facets1.jar, just as we needed for compilation, and Beatrix additionally needs the XML JARs jaxp.jar and parser.jar. However, note that we don't need jtrix.jar in the launch descriptor. This is always the case, because we can always count on it being there on whichever node we happen to be running on.
-access
Some arbitrary label for our access points. This simply tells jtrixmaker that all access points are one particular kind of netlet, with this arbitrary label. It ties closely with...
-codebase
Says what JARs are needed for this particular kind of netlet. The first argument is the access point label we just gave. The rest of the arguments say what JARs it needs (all the JARs we gave before except the XML ones). The upshot is that when we connect to our application we get an access point netlet which needs fewer JARs. Thus is loads quicker. See Section [*].
-plugins
A series of one or more plugins, which Beatrix will try to add as classes, but not initialise. At least one of these should be the IManagerLifeCycle plugin. On launch the Manager will do a lookup for an IManagerLifeCycle plugin and will call the first one it finds for a cold start. In short, if we only list an IManagerLifeCycle plugin, and that adds all the manager's other plugins, then that will be fine.
The result is something like this:


<!DOCTYPE application PUBLIC "-//jtrix.org//TEXT application-0.1//EN"
    "http://www.jtrix.org/dtd/application-0.1.dtd">
<application>
    <jar jar_id='beatrix'>
        <url>file:/usr/lib/jtrix/beatrix.jar</url>
    </jar>
    <jar jar_id='skeleton2'>
        <url>file:/usr/lib/jtrix/skeleton2.jar</url>
    </jar>
    <jar jar_id='parser.jar'>
        <url>file:/usr/lib/jtrix/parser.jar</url>
    </jar>
    <jar jar_id='libjtrix'>
        <url>file:/usr/lib/jtrix/libjtrix.jar</url>
    </jar>
    <jar jar_id='facets1.jar'>
        <url>file:/usr/lib/jtrix/facets1.jar</url>
    </jar>
    <jar jar_id='jaxp.jar'>
        <url>file:/usr/lib/jtrix/jaxp.jar</url>
    </jar>
    <codebase codebase_id='ap'>
        <element jar_id='beatrix'/>
        <element jar_id='skeleton2'/>
        <element jar_id='libjtrix'/>
        <element jar_id='facets1.jar'/>
    </codebase>
    <codebase codebase_id='DEFAULT_FOR_ALL'>
        <element jar_id='skeleton2'/>
        <element jar_id='parser.jar'/>
        <element jar_id='jaxp.jar'/>
        <element jar_id='beatrix'/>
        <element jar_id='libjtrix'/>
        <element jar_id='facets1.jar'/>
    </codebase>
    <boot class='org.jtrix.project.beatrix.plugins.netlets.Manager'
          codebase_id='DEFAULT_FOR_ALL'/>
    <cmdline>
        <argument type="string" name="plugins" required="yes">
            org.jtrix.project.skeleton2.plugins.LifeCyclePlugin </argument>
        <argument type="x500dn" name="x500" required="yes">
            O=jtrix CN=skeleton2</argument>
        <argument type="string" name="name" required="yes">
            Initial Manager</argument>
    </cmdline>
    <config>
        <![CDATA[
            ....
        ]]>
    </config>
</application>

This launcher descriptor allows us to launch our application and all its JARs (referenced in the XML) onto a remote node. See Section [*] for more details on this.

See Section [*] for how we use the console to run our application.

Nik Silver 2002-03-09