[Index]

launch


Launch an application via it's main method. The application is launched in same JVM as Oddjob, but in it's own class loader.

Property Summary

args The arguments to pass to main.
classLoader The class loader in which to find the main class.
className The name of the class that contains the main method.
name The name of this job.

Example Summary

Example 1 An Oddjob the launches Oddjob.

Property Detail

args

Configured ByELEMENT
AccessREAD_WRITE
RequiredNo.

The arguments to pass to main.

classLoader

Configured ByELEMENT
AccessREAD_WRITE
RequiredYes.

The class loader in which to find the main class.

className

Configured ByATTRIBUTE
AccessREAD_WRITE
RequiredYes.

The name of the class that contains the main method.

name

Configured ByATTRIBUTE
AccessREAD_WRITE
RequiredNo.

The name of this job.


Examples

Example 1

An Oddjob the launches Oddjob. args[0] is org.oddjob.Main, args[1] is the oddjob home directory. The classes directory is included in the class path for the log4j.properties file otherwise Log4j would attempt to use one from ClassLoader.getSystemLoader() which will be the original application class loader.

<oddjob id="this">
    <job>
        <launch className="${this.args[1]}">
            <args>
                <list>
                    <values>
                        <value value="-nb"/>
                        <value value="-f"/>
                        <value value="${this.args[0]}/test/conf/echo-class-loader.xml"/>
                        <value value="-l"/>
                        <value value="${this.args[0]}/${this.args[2]}"/>
                    </values>
                </list>
            </args>
            <classLoader>
                <url-class-loader noInherit="true">
                    <files>
                        <files files="${this.args[3]}/lib/*.jar">
                            <list>
                                <file file="${this.args[3]}/classes"/>
                                <file file="${this.args[3]}/opt/classes"/>
                            </list>
                        </files>
                    </files>
                </url-class-loader>
            </classLoader>
        </launch>
    </job>
</oddjob>


(c) R Gordon Ltd 2005 - Present