|
|
|
|
|
|
|
Re: Kernel not starting when launched from java program [message #788194 is a reply to message #788128] |
Wed, 01 February 2012 13:22 |
|
For external processes I'm using Apache's commons.exec:
CommandLine cmdLine = new CommandLine("executable");
cmdLine.addArguments(...)
DefaultExecutor executor = new DefaultExecutor();
executor.setWorkingDirectory(workingDir);
ExecuteWatchdog watchdog = new ExecuteWatchdog(20 * 60 * 1000); // 20 minutes
executor.setWatchdog(watchdog);
PumpStreamHandler pumpHandler = new PumpStreamHandler();
executor.setStreamHandler(pumpHandler);
exitCode = executor.execute(cmdLine);
if (executor.isFailure(exitCode)) {
...
}
You don't need the watchdog in most cases if this will be used for Virgo productively. If you are running tests or using Virgo for short living tasks this can be handy.
|
|
|
|
Powered by
FUDForum. Page generated in 0.04363 seconds