java.lang.Object
org.wildfly.core.launcher.ProcessHelper
A helper class to help with managing a process.
- Author:
- James R. Perkins
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ThreadaddShutdownHook(Process process) Adds a shutdown hook for the process.static intdestroyProcess(Process process) Destroys the process if the process is notnull.static booleanprocessHasDied(Process process) Deprecated, for removal: This API element is subject to removal in a future version.
-
Constructor Details
-
ProcessHelper
public ProcessHelper()
-
-
Method Details
-
processHasDied
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:
trueif the process has died, otherwisefalse- See Also:
-
destroyProcess
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
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")
-