org.sonar.process
Class ProcessUtils

java.lang.Object
  extended by org.sonar.process.ProcessUtils

public class ProcessUtils
extends Object


Method Summary
static void closeStreams(Process process)
           
static boolean isAlive(Process process)
          Do not abuse to this method.
static boolean sendKillSignal(Process process)
          Send kill signal to stop process.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isAlive

public static boolean isAlive(@Nullable
                              Process process)
Do not abuse to this method. It uses exceptions to get status.

Returns:
false if process is null or terminated, else true.

sendKillSignal

public static boolean sendKillSignal(@Nullable
                                     Process process)
Send kill signal to stop process. Shutdown hooks are executed. It's the equivalent of SIGTERM on Linux. Correctly tested on Java 6 and 7 on both Mac/MSWindows

Returns:
true if the signal is sent, false if process is already down

closeStreams

public static void closeStreams(@Nullable
                                Process process)


Copyright © 2009–2015 SonarSource. All rights reserved.