public class

ProcessWrapper

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

Class Overview

Safe wrapper around ProcessBuilder and Process.

Summary

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()
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public ProcessWrapper (String... cmdarray)

Execute a process without timeout.

Parameters
cmdarray command

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

Execute a process with timeout.

Parameters
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 ()

Throws
IOException

public String toString ()

public void waitForCompletion ()