public class SimplePipe extends java.lang.Object implements Pipe
ExternalProcessLauncher
).Constructor and Description |
---|
SimplePipe(java.io.InputStream input,
java.lang.String[] messageDelimiters,
java.io.OutputStream output,
SolverCommunication session,
java.lang.Process process)
Creates a new SimplePipe.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Forcibly closes the Pipe by destroying the process.
|
SolverCommunication |
getSolverCommunication()
Can be used to obtain the messages sent to and from the solver as well as its final result.
|
java.lang.String |
readMessage()
Reads a message from the external process.
|
void |
sendMessage(java.lang.String message)
Sends a message to the external process the Pipe is connected to.
|
public SimplePipe(@Nonnull java.io.InputStream input, @Nonnull java.lang.String[] messageDelimiters, @Nonnull java.io.OutputStream output, @Nonnull SolverCommunication session, @Nonnull java.lang.Process process)
input
- the InputStream connected to the merged stdout and stderr of the external
processmessageDelimiters
- the delimiters which separate one message from anotheroutput
- the OutputStream connected to stdin of the external processsession
- the message list where to log the messages toprocess
- the external process this pipe is connected topublic void sendMessage(@Nonnull java.lang.String message) throws java.io.IOException
Pipe
sendMessage
in interface Pipe
message
- the message to sendjava.io.IOException
- if an I/O error occurs@Nullable public java.lang.String readMessage() throws java.io.IOException, java.lang.InterruptedException
Pipe
readMessage
in interface Pipe
java.io.IOException
- if reading failsjava.lang.InterruptedException
- if interrupted while waiting@Nonnull public SolverCommunication getSolverCommunication()
Pipe
getSolverCommunication
in interface Pipe
public void close()
Pipe
Copyright © 2003-2019 The KeY-Project.