public class ExternalProcessLauncher<T> extends Object
Modifier and Type | Field and Description |
---|---|
private ReentrantLock |
lockProcess
lock for the process-object in order to guarantee synchronous access: If you want to access on
process
then acquire first the lock! |
private Pipe<T> |
pipe |
private Process |
process |
Constructor and Description |
---|
ExternalProcessLauncher(T session,
String[] messageDelimiters) |
Modifier and Type | Method and Description |
---|---|
(package private) T |
getCommunication()
Call this method only after the pipe has been stopped.
|
void |
launch(String[] command,
String initialMessage,
PipeListener<T> listener)
Main procedure of the class.
|
void |
stop()
Stops the external process: In particular the pipe is closed and the process is destroyed.
|
private Process process
private ReentrantLock lockProcess
process
then acquire first the lock!public void launch(String[] command, String initialMessage, PipeListener<T> listener) throws Throwable
Throwable
T getCommunication()
public void stop()