OpenCCM - Writing Launcher Descriptions in XML

Table of Contents

  1. About the Launcher
  2. The Launcher Descriptor (LD)
    1. <launcher> Element
    2. <include> Element
    3. <run> Element
    4. <context> Element
    5. <classpath> Element
    6. <path> Element
    7. <arguments> Element
    8. <argument> Element
    9. <properties> Element
    10. <property> Element

About the Launcher

The launcher is a tool developed by the OpenCCM project for describing and supporting the execution of Java applications.

The configuration mechanism describes:

  • Compiled files (eg: jar, classes, ...).
  • Java properties.
  • The application main class full name.
  • Application parameters.
  • The mode of execution.
  • Additional contexts of execution.

This powerful tool allows us to:

  • Describe various scenario using a specific XML configuration file independently of the target operating system.
  • Reference remote elements such as Jar file, launcher file using URL formalism.
  • Override the standard Java Virtual Machine classes (eg: rt.jar).
  • Override the default Object Request Broker (ORB) provided with the standard Java Development Kit.
  • Execute multiple applications in the same process.
  • Decrease the number of running Java Virtual Machines.

The Launcher Descriptor (LD)

The goal of this document is to provide information on the way to use the Launcher Descriptor (LD) to describe launcher configurations.

<launcher> Element

launcher
DescriptionThe launcher element is the root element of the Launcher Descriptor.
XML DTD <!ELEMENT launcher (include|run|context|classpath|arguments|properties)*>
ParentNone.
AttributeNone.
Children Elements
  • include:
    The include element defines a Launcher Descriptor to include.

  • run:
    The run element defines a particular application configuration.

  • context:
    The context element describes a particular context of execution.

  • classpath:
    The classpath element defines a set of paths where classes are stored.

  • arguments:
    The arguments element defines a set of arguments to pass to the main method of an application to run.

  • properties:
    The properties element defines a set of Java properties which will be available in the application through the System.getProperties() method.

Example <launcher>
  <include> ... </include>
  <run> ... </run>
  <classpath> ... </classpath>
  <arguments> ... </arguments>
  <properties> ... </properties>
  <context> ... </context>
  <classpath> ... </classpath>
  <properties> ... </properties>
  <context> ... </context>
  <arguments> ... </arguments>
  <classpath> ... </classpath>
</launcher>

<include> Element

include
Description The include element describes an external Launcher Descriptor configuration to include in the current configuration.
XML DTD <!ELEMENT include EMPTY >
<!ATTLIST include url CDATA #REQUIRED >
Parent launcher.
Attribute
  • url CDATA:
    The URL of a Launcher Descriptor file to include.
    Warning: The specified URL should follow the java.net.URL syntax.

Child ElementNone.
Examples <include url="file:launcher/OpenCCM.xml" />
<include url="http://www.server.org/launcher/OpenCCM.xml" />
<!-- this line include configuration files stored in the launcher/ directory -->
<include url="file:launcher/" />

<run> Element

run
Description The run element describes a standalone configuration for running an application.
XML DTD <!ELEMENT run EMPTY >
<!ATTLIST run
  id            ID     #REQUIRED
  mainclassname CDATA  #REQUIRED
  mode          ( normal | thread | daemon ) "thread"
  classpath     IDREFS #IMPLIED
  arguments     IDREFS #IMPLIED
  properties    IDREFS #IMPLIED
  contexts      IDREFS #IMPLIED
>
Parent launcher.
Attributes
  • id ID:
    The identifier of the run element. Default run identifier is default.

  • mainclassname CDATA:
    The full name of the application main class.

  • mode CDATA:
    The mode of execution for the platform. Available values are normal, thread or daemon. Default value is thread:

    • normal value results in a sequential execution of run elements when they are launched together.
    • thread value results in a concurrent execution of run elements when they are launched together.
    • daemon is equivalent to thread but the Java Virtual Machine exits when all runs (except daemon runs) exits.
  • classpath IDREFS:
    Identifiers of the classpath to use with the application. Multiple classpath could be specified using space separators.

  • arguments IDREFS:
    Identifiers of the arguments to use with the application. Multiple arguments could be specified using space separators.

  • properties IDREFS:
    Identifiers of the properties to use with the application. Multiple properties could be specified using space separators.

  • contexts IDREFS:
    Identifiers of the contexts to load with the application. Multiple context could be specified using space separators.

Child ElementNone.
Example <run id="default"
  mainclassname="MyPackage.MyApplicationName"
  classpath="MyClasspath1 MyClasspath2"
  properties="MyProperties1 MyProperties2"
  arguments="MyArguments1 MyArguments2"
  contexts="MyContext1 MyContext2"
/>

<context> Element

context
Description The context element describes an execution context environment for a run.
XML DTD <!ELEMENT context EMPTY >
<!ATTLIST context
  id         ID     #REQUIRED
  classpath  IDREFS #IMPLIED
  arguments  IDREFS #IMPLIED
  properties IDREFS #IMPLIED
  contexts   IDREFS #IMPLIED >
Parent launcher.
Attributes
  • id CDATA:
    The identifier of the context.

  • classpath IDREFS:
    Identifiers of the classpath to use with the context. Multiple classpath could be specified using space separators.

  • arguments IDREFS:
    Identifiers of the arguments to use with the context. Multiple arguments could be specified using space separators.

  • properties IDREFS:
    Identifiers of the properties to use with the context. Multiple properties could be specified using space separators.

  • contexts IDREFS:
    Identifiers of the contexts to load with the application. Multiple context could be specified using space separators.

Child ElementNone.
Example <context id="MyContext"
  classpath="MyClasspath3 MyClasspath4"
  properties="MyProperties3 MyProperties4"
  arguments="MyArguments3 MyArguments4"
  contexts="MyContext3 MyContext4"
/>

<classpath> Element

classpath
Description The classpath element describes the content of the classpath variable of the Java Virtual Machine (JVM) which would be launched.
XML DTD <!ELEMENT classpath (path)* >
<!ATTLIST classpath
  id ID #REQUIRED
>
Parent launcher.
Attribute
  • id ID:
    The identifier of the classpath element.

Child Element
  • path:
    The path element defines a reference to a particular set of classes.

Example <classpath id="MyClasspath" >
  <path ... />
  <path ... />
</classpath>

<path> Element

path
Description The path element describes a reference to a particular resource which could be a directory or a Java archive (jar).
XML DTD <!ELEMENT path EMPTY >
<!ATTLIST path
  url       CDATA #IMPLIED
  classpath IDREF #IMPLIED
>
Parent classpath.
Attribute
  • url CDATA:
    The URL of a resource (either directory or archive).
    Warning: the specified URL should follow the java.net.URL syntax.

  • classpath IDREF:
    The reference to an existing classpath definition.

Child ElementNone.
Examples <path url="file:lib/MyArchive.jar" />
<!-- this line include compiled files stored in the lib/ directory -->
<path url="http://www.server.org/lib/" />
<path classpath="MyClasspath" />

<arguments> Element

arguments
Description The arguments element describes a set of command line argument values for your application.
XML DTD <!ELEMENT arguments (argument)* >
<!ATTLIST arguments
  id ID #REQUIRED
>
Parent launcher.
Attribute
  • id ID:
    The identifier of the arguments element.

Child Element
  • argument:
    The argument element defines a particular argument(s) value.

Example <arguments id="MyArguments" >
  <argument ... />
  <argument ... />
</arguments>

<argument> Element

argument
Description The argument element describes an argument value.
XML DTD <!ELEMENT argument EMPTY >
<!ATTLIST argument
  value     CDATA #IMPLIED
  line      CDATA #IMPLIED
  arguments IDREF #IMPLIED
>
Parent arguments.
Attributes
  • value CDATA:
    The value of the argument.
    Warning: An argument value is considered as one argument even if the value contains spaces.

  • line CDATA:
    A line argument.
    Warning: An argument line is considered as a list of arguments separated by spaces.

  • arguments IDREF:
    The reference to an existing arguments definition.

Child ElementNone.
Examples <argument value="MyArgument" />
<argument value="MyArgument1 MyArgument2" />
<-- this argument is different from the above one -->
<argument line="MyArgument1 MyArgument2" />
<argument arguments="MyArguments" />

<properties> Element

properties
Description The properties element defines a set of Java properties.
XML DTD <!ELEMENT properties (property)* >
<!ATTLIST properties
  id ID #REQUIRED
>
Parent launcher.
Attribute
  • id ID:
    The identifier of the property set.

Child Element
  • property:
    The property element defines a particular property entry.

Example <properties id="MyProperties" >
  <property ... />
  <property ... />
</properties>

<property> Element

property
Description The property element defines a particular property entry.
XML DTD <!ELEMENT property EMPTY >
<!ATTLIST property
  name       CDATA #IMPLIED
  value      CDATA #IMPLIED
  properties IDREF #IMPLIED
>
Parent properties.
Attributes
  • name CDATA:
    The identifier of the property.

  • value CDATA:
    The value of the property.

  • properties IDREF:
    The reference to an existing properties definition.

Child ElementNone.
Examples <property name="MyProperty" />
<property name="MyIdentifier" value="MyValue" />
<property properties="MyProperties" />
Copyright © 1999-2005, ObjectWeb Consortium | contact | webmaster | Last modified at 2005-07-07 02:04 PM