I am running the function below executionManager.executeOnce(server::spawnExe):
public void spawnExe() {
CommandLine cmdLine = CommandLine.parse(installedServerPath);
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
PumpStreamHandler streamHandler = new PumpStreamHandler(outputStream);
DefaultExecutor executor = new DefaultExecutor();
executor.setStreamHandler(streamHandler);
int exitCode = 0;
try {
exitCode = executor.execute(cmdLine);
logger.info("server is dying now");
logger.info("server is dying now");
logger.info("server is dying now");
logger.info("server is dying now");
logger.info("server is dying now");
logger.info(String.format("exit code, %d", exitCode));
} catch (IOException e) {
logger.error(e.getStackTrace().toString());
}
}
So the function is hanging during execution which is fine for me, but when i run the following during “public void shutdown()”:
executionManager.unRegisterAll(“myModule”);
executionManager.shutdown();
The exe doesnt stop running…