// If verbose, LauncherBootstrap.main() returns only after
// the appserver JVM exits.
mainMethod.invoke(null, argsArray);
} catch ( Exception ex ) {
throw new InstanceException(
getMessages().getInstanceStartupExceptionMessage(
getConfig().getDisplayName()), ex);
}
} else if (System.getProperty("com.sun.aas.processLauncher") != null && verbose) {
// add arguments to main command, native must come first
if (nativeLauncher) {
// use native launcher, add in argument
alCmd.add("native");
}
if (debug) alCmd.add("debug");
if (verbose) alCmd.add("verbose");
// 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);
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) {