public class


extends Object
   ↳ com.pnfsoftware.jeb.util.concurrent.ProcessWrapper

Class Overview

Safe wrapper around ProcessBuilder and Process.


Public Constructors
ProcessWrapper(String... cmdarray)
Execute a process without timeout.
ProcessWrapper(long timeout, String... cmdarray)
Execute a process with timeout.
Public Methods
synchronized InputStream getProcessError()
synchronized OutputStream getProcessInput()
synchronized InputStream getProcessOutput()
synchronized Integer getReturnCode()
synchronized boolean isAlive()
static boolean isKillSpawnedProcessesOnShutdown()
synchronized void kill()
static void setKillSpawnedProcessesOnShutdown(boolean enabled)
synchronized ProcessWrapper start()
String toString()
void waitForCompletion()
Inherited Methods
From class java.lang.Object

Public Constructors

public ProcessWrapper (String... cmdarray)

Execute a process without timeout.

cmdarray command

public ProcessWrapper (long timeout, String... cmdarray)

Execute a process with timeout.

timeout timeout in milliseconds.
cmdarray command

Public Methods

public synchronized InputStream getProcessError ()

public synchronized OutputStream getProcessInput ()

public synchronized InputStream getProcessOutput ()

public synchronized Integer getReturnCode ()

public synchronized boolean isAlive ()

public static boolean isKillSpawnedProcessesOnShutdown ()

public synchronized void kill ()

public static void setKillSpawnedProcessesOnShutdown (boolean enabled)

public synchronized ProcessWrapper start ()


public String toString ()

public void waitForCompletion ()