class ProcessUtil {

	public static int getPID(final Process process) throws ProcessIDNotRetrievableException {
		Integer pid;
		try {
			if (getOS() == EOperatingSystem.LINUX || getOS() == EOperatingSystem.MAC) {
				/* get the PID on unix/linux systems */
				Field f = process.getClass().getDeclaredField("pid");
				f.setAccessible(true);
				pid = f.getInt(process);
				return pid;

			} else if (getOS() == EOperatingSystem.WIN) {/* determine the pid on windows plattforms */
				return WinUtils.getWindowsProcessId(process).intValue();
			}
		} catch (Exception e) {
			throw new ProcessIDNotRetrievableException("Could not retrieve process ID", e);
		}
		throw new UnsupportedOperationException();
	}

	private  ProcessUtil();

}