exense-basic-commons/src/main/java/ch/exense/commons/processes/ManagedProcess.java
/**
	 * Causes the current thread to wait, if necessary, until the process has
	 * terminated, or the specified waiting time elapses.
	 * 
	 * @param timeout the maximum time to wait in ms
	 * @throws TimeoutException     if the process doesn't exit within the defined
	 *                              timeout
	 * @throws InterruptedException if the thread is interrupted while waiting for
	 *                              the process to exit
	 */
Causes the current thread to wait, if necessary, until the process has
terminated, or the specified waiting time elapses.

@param timeout the maximum time to wait in ms
@throws TimeoutException     if the process doesn't exit within the defined
timeout
@throws InterruptedException if the thread is interrupted while waiting for
the process to exit
Causes the current thread to wait if necessary until the process has terminated or the specified waiting time elapses . @param timeout the maximum time to wait in ms @throws TimeoutException if the process doesn ' t exit within the defined timeout @throws InterruptedException if the thread is interrupted while waiting for the process to exit
public int waitFor(long timeout) throws TimeoutException, InterruptedException {
		boolean terminated = process.waitFor(timeout, TimeUnit.MILLISECONDS);
		if (!terminated) {
			throw new TimeoutException(
					"The process " + id + " didn't exit within the defined timeout of " + timeout + "ms");
		}
		return process.exitValue();
	}
public int waitFor ( long timeout ) throws TimeoutException , InterruptedException { boolean terminated = process . waitFor ( timeout , TimeUnit . MILLISECONDS ) ; if ( ! terminated ) { throw new TimeoutException ( "The process " + id + " didn't exit within the defined timeout of " + timeout + "ms" ) ; } return process . exitValue ( ) ; }
Causes the current thread to wait, if necessary, until the process has
 terminated, or the specified waiting time elapses.
Causes the current thread to wait if necessary until the process has terminated or the specified waiting time elapses .