command=new String[alCmd.size()];
command=(String[])alCmd.toArray(command);
try {
// exec process directly to exercise needed control
ProcessExecutor exec = new ProcessExecutor(command, securityInfo);
// set verbose flag so process error stream get redirected to stderr
exec.setVerbose(verbose);
// call execute so it will not be timed out
exec.execute(false, false);
process=exec.getSubProcess();
// this will force process to wait for executing process
int exitValue=process.waitFor();
System.exit(exitValue);
} catch (Exception e) {
throw new InstanceException(_strMgr.getString("procExecError"), e);
}
} else {
// add arguments to main command, native must come first
if (nativeLauncher) {
// use native launcher, add in argument
alCmd.add("native");
}
// check to see if debug is enabled
if (debug) {
alCmd.add("debug");
}
// addin command line args
if (commandLineArgs != null) {
for(int ii=0; ii < commandLineArgs.length; ii++) {
alCmd.add(commandLineArgs[ii]);
}
}
// extract full command
command=new String[alCmd.size()];
command=(String[])alCmd.toArray(command);
// call method for executing so can be overriden in descendants
// also, keep executor for any error information
ProcessExecutor processExec=startInstanceExecute(command, securityInfo);
process=processExec.getSubProcess();
waitUntilStarting(processExec);
waitUntilStarted();
postStart();
}