The <execJava> step executes a JavaTM executor instance on the target host. If the executor instance raises an exception, the step fails and execution stops.
The <execJava> step has the following optional child elements:
<argList> – A list of arguments to pass to the executor instance. If you specify this element, it can only appear one time.
<assignOutput> – The name of the local variable to assign the value of the InfoStream written by the called class. If no content is written to the stream, the empty string is assigned.
The <assignOutput> element has one attribute, varName, whose value is the name of the local variable to which to assign the standard output of the called command.
<assignError> – The name of the local variable to assign the value of the ErrorStream written by the called class. If no content is written to the stream, the empty string is assigned.
The <assignError> element has one attribute, varName, whose value is the name of the local variable to which to assign the standard error of the called command.
The <execJava> element has the following attributes:
className – A required attribute that is the full name of a public class with a public no-arg constructor that implements the ExecutorFactory interface. For more information, see execJava API in Sun N1 Service Provisioning System 5.2 Plug-in Development Guide. This attribute can reference simple substitution variables.
classPath – An optional attribute that is the class path that contains the class named by the className attribute. If this attribute is omitted, the system class path of the remote agent is used. The class path format is a semicolon-separated list of absolute paths to Java Archive (JAR) files on the agent. This attribute can reference simple substitution variables.
timeout – An optional attribute of type positiveInteger, which specifies the number of seconds to wait for the command to complete before timing out. If this attribute is omitted, the plan's <execNative> timeout period applies. The value should be greater than 0.
label – An optional attribute of type String that defines a persisted label assigned to this <execJava> step used to more easily retrieve the output later. The label is not required to be unique.
When an <execJava> step is contained within a component, the step typically calls classes that are contained within one or more resources that are deployed by that component. When the step is contained within a plan, the classes called are already resident on the agent. The classes can be a system class of the agent itself or a resource that was deployed with an existing component.
The semantics of the <assign*> elements are similar to those of the <assign> step. A check-in error is triggered if the same variable name is specified for the <assignOutput> and <assignError> elements. The output and error streams are truncated in exactly the same way as the database output is currently truncated, that is, by specifying a value for pe.maxOutputSnapshotBytes in the configuration file.
If the variable indicated by varName for the <assign*> elements does not exist in a plan or component local scope or a plan local scope, a check-in error will result.