[Index]

java


Execute a Java Program in a separate process.

Property Summary

className The class name
classPath The class path of the java program.
dir The working directory.
environment An environment variable to be set before the program is executed.
exitValue The exit value of the process.
name A name, can be any text.
newEnvironment Create a fresh/clean environment.
programArgs Space separated program arguments
redirectStderr Redirect the standard error stream in standard output.
stderr An output to where stderr of the proces will be written.
stdin An input stream which will act as stdin for the process.
stdout An output to where stdout for the process will be written.
stop This flag is set by the stop method and should be examined by any Stoppable jobs in their processing loops.
stopForcibly Forcibly stop the process on stop.
vmArgs Space separated vm arguments

Example Summary

Example 1 A simple example.

Property Detail

className

Configured ByATTRIBUTE
AccessREAD_WRITE
Requiredyes.

The class name

classPath

Configured ByELEMENT
AccessREAD_WRITE
Requiredno.

The class path of the java program.

dir

Configured ByATTRIBUTE
AccessREAD_WRITE
RequiredNo

The working directory.

environment

Configured ByELEMENT
AccessREAD_WRITE
RequiredNo.

An environment variable to be set before the program is executed. This is a map like property.

exitValue

AccessREAD_ONLY

The exit value of the process.

name

Configured ByATTRIBUTE
AccessREAD_WRITE
RequiredNo.

A name, can be any text.

newEnvironment

Configured ByATTRIBUTE
AccessREAD_WRITE
RequiredNo.

Create a fresh/clean environment.

programArgs

Configured ByATTRIBUTE
AccessREAD_WRITE
Requiredno.

Space separated program arguments

redirectStderr

Configured ByATTRIBUTE
AccessREAD_WRITE
RequiredNo.

Redirect the standard error stream in standard output.

stderr

Configured ByELEMENT
AccessREAD_WRITE
RequiredNo.

An output to where stderr of the proces will be written.

stdin

Configured ByELEMENT
AccessREAD_WRITE
RequiredNo.

An input stream which will act as stdin for the process.

stdout

Configured ByELEMENT
AccessREAD_WRITE
RequiredNo.

An output to where stdout for the process will be written.

stop

AccessREAD_ONLY
RequiredRead Only.

This flag is set by the stop method and should be examined by any Stoppable jobs in their processing loops.

stopForcibly

Configured ByATTRIBUTE
AccessREAD_WRITE
RequiredNo, defaults to false.

Forcibly stop the process on stop.

vmArgs

Configured ByATTRIBUTE
AccessREAD_WRITE
Requiredno.

Space separated vm arguments


Examples

Example 1

A simple example.

<oddjob>
    <job>
        <java id="javaExample" name="Java Example" className="org.oddjob.jobs.HelloMain" programArgs="Alice Bob" vmArgs="-Dour.greeting=Hello">
          <classPath>
              <list>
                  <values>
                      <value value="${classPath}"/>
                  </values>
              </list>
          </classPath>
        </java>
    </job>
</oddjob>


(c) R Gordon Ltd 2005 - Present