/** * Constructs a new ProcessLauncher. Parses this process's RuntimeMXBean name * for the pid (process id). * * @param pidFile the file to create and write pid into * @param force if true then the pid file will be replaced if it already exists * * @throws FileAlreadyExistsException if the pid file already exists and force is false * @throws IOException if unable to write pid (process id) to pid file * @throws PidUnavailableException if the pid cannot be parsed from the RuntimeMXBean name * * @see java.lang.management.RuntimeMXBean */ public LocalProcessLauncher(final File pidFile, final boolean force) throws FileAlreadyExistsException, IOException, PidUnavailableException { this.pid = ProcessUtils.identifyPid(); this.pidFile = pidFile; writePid(force); }
/** * Constructs a new ProcessLauncher. Parses this process's RuntimeMXBean name * for the pid (process id). * * @param pidFile the file to create and write pid into * @param force if true then the pid file will be replaced if it already exists * * @throws FileAlreadyExistsException if the pid file already exists and force is false * @throws IOException if unable to write pid (process id) to pid file * @throws PidUnavailableException if the pid cannot be parsed from the RuntimeMXBean name * * @see java.lang.management.RuntimeMXBean */ public LocalProcessLauncher(final File pidFile, final boolean force) throws FileAlreadyExistsException, IOException, PidUnavailableException { this.pid = ProcessUtils.identifyPid(); this.pidFile = pidFile; writePid(force); }