Class ProcessWrapper
java.lang.Object
com.pnfsoftware.jeb.util.concurrent.ProcessWrapper
Safe wrapper around
ProcessBuilder
and Process
.-
Constructor Summary
ConstructorsConstructorDescriptionProcessWrapper
(long timeout, String... cmdarray) Execute a process with timeout.ProcessWrapper
(String... cmdarray) Execute a process without timeout. -
Method Summary
Modifier and TypeMethodDescriptionboolean
isAlive()
static boolean
void
kill()
static void
setKillSpawnedProcessesOnShutdown
(boolean enabled) start()
toString()
void
-
Constructor Details
-
ProcessWrapper
Execute a process without timeout.- Parameters:
cmdarray
- command
-
ProcessWrapper
Execute a process with timeout.- Parameters:
timeout
- timeout in milliseconds.cmdarray
- command
-
-
Method Details
-
isKillSpawnedProcessesOnShutdown
public static boolean isKillSpawnedProcessesOnShutdown() -
setKillSpawnedProcessesOnShutdown
public static void setKillSpawnedProcessesOnShutdown(boolean enabled) -
start
- Throws:
IOException
-
kill
public void kill() -
waitForCompletion
public void waitForCompletion() -
isAlive
public boolean isAlive() -
getProcessInput
-
getProcessOutput
-
getProcessError
-
getReturnCode
-
toString
-