[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
Property Detail
args
Configured By | ELEMENT |
Access | READ_WRITE |
Required | No. |
The arguments to pass to main.
classLoader
Configured By | ELEMENT |
Access | READ_WRITE |
Required | Yes. |
The class loader in which to find the main class.
className
Configured By | ATTRIBUTE |
Access | READ_WRITE |
Required | Yes. |
The name of the class that contains the main method.
name
Configured By | ATTRIBUTE |
Access | READ_WRITE |
Required | No. |
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