public int waitForResult() { launch(); try { return process.waitFor(); } catch ( InterruptedException e ) { Thread.interrupted(); return 0; } finally { done(); } } }
Process process = Runtime.getRuntime().exec( args.toArray( new String[args.size()] ) ); final ProcessStreamHandler processOutput = new ProcessStreamHandler( process, false ); processOutput.launch(); final Future<Integer> realFuture = FutureAdapter.processFuture( process ); return new Future<Integer>()