- java.lang.Object
-
- org.wildfly.core.launcher.ProcessHelper
-
public class ProcessHelper extends Object
A helper class to help with managing a process.- Author:
- James R. Perkins
-
-
Constructor Summary
Constructors Constructor Description ProcessHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static Thread
addShutdownHook(Process process)
Adds a shutdown hook for the process.static int
destroyProcess(Process process)
Destroys the process if the process is notnull
.static boolean
processHasDied(Process process)
Deprecated, for removal: This API element is subject to removal in a future version.
-
-
-
Method Detail
-
processHasDied
@Deprecated(forRemoval=true) public static boolean processHasDied(Process process)
Deprecated, for removal: This API element is subject to removal in a future version.Checks to see if the process has died.- Parameters:
process
- the process to check- Returns:
true
if the process has died, otherwisefalse
- See Also:
Process.isAlive()
-
destroyProcess
public static int destroyProcess(Process process) throws InterruptedException
Destroys the process if the process is notnull
.- Parameters:
process
- the process to destroy, terminate- Returns:
- 0 if the process was successfully destroyed
- Throws:
InterruptedException
-
addShutdownHook
public static Thread addShutdownHook(Process process)
Adds a shutdown hook for the process.- Parameters:
process
- the process to add a shutdown hook for- Returns:
- the thread set as the shutdown hook
- Throws:
SecurityException
- If a security manager is present and it deniesRuntimePermission("shutdownHooks")
-
-