Java API for running multiple processes in parallel in a controlled way