public class ExternalProcessLauncher<T>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.concurrent.locks.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 java.lang.Process |
process |
Constructor and Description |
---|
ExternalProcessLauncher(T session,
java.lang.String[] messageDelimiters) |
Modifier and Type | Method and Description |
---|---|
(package private) T |
getCommunication()
Call this method only after the pipe has been stopped.
|
void |
launch(java.lang.String[] command,
java.lang.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 java.lang.Process process
private java.util.concurrent.locks.ReentrantLock lockProcess
process
then acquire first the lock!ExternalProcessLauncher(T session, java.lang.String[] messageDelimiters)
public void launch(java.lang.String[] command, java.lang.String initialMessage, PipeListener<T> listener) throws java.lang.Throwable
java.lang.Throwable
T getCommunication()
public void stop()