Reputation: 363
Is there a way to tell Apache DefaultExecutor not to wait for result and go on with code? Currently, it waits for a called program or script to terminate.
Upvotes: 0
Views: 885
Reputation: 16128
The DefaultExecutor has methods for asynchronous execution.
public void execute(CommandLine command, ExecuteResultHandler handler)
throws ExecuteException, IOException
and
public void execute(CommandLine command, Map<String,String> environment, ExecuteResultHandler handler)
throws ExecuteException, IOException
If you want to ignore the results, you can pass a no-op implementation of the ExecuteResultHandler.
Upvotes: 1