Package org.moeaframework.problem
Class ExternalProblem.Instance
java.lang.Object
org.moeaframework.problem.ExternalProblem.Instance
- All Implemented Interfaces:
Closeable,AutoCloseable
- Enclosing class:
- ExternalProblem
Instance of the external problem. This manages the lifecycle of the process and connections.
-
Constructor Summary
ConstructorsConstructorDescriptionInstance(ExternalProblem.Builder builder) Constructs an instance of an external problem. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()getDebug()Returns the stream where debugging logs are written.Returns the underlying process, primarily intended for testing purposes.Returns the reader used to read content from the external problem.Returns the underlying socket, primarily intended for testing purposes.Returns the writer used to write content to the external problem.booleanReturnstrueif the underlying process or connections are established;falseotherwise.voidstart()Starts the underlying process and establishes any connections.
-
Constructor Details
-
Instance
Constructs an instance of an external problem.- Parameters:
builder- the builder
-
-
Method Details
-
isStarted
public boolean isStarted()Returnstrueif the underlying process or connections are established;falseotherwise.- Returns:
trueif the underlying process or connections are established;falseotherwise
-
start
Starts the underlying process and establishes any connections.- Throws:
IOException- if an I/O error occurred
-
getReader
Returns the reader used to read content from the external problem.- Returns:
- the reader
-
getWriter
Returns the writer used to write content to the external problem.- Returns:
- the writer
-
getDebug
Returns the stream where debugging logs are written.- Returns:
- the debug stream
-
getProcess
Returns the underlying process, primarily intended for testing purposes.- Returns:
- the underlying process, or
nullif there is none
-
getSocket
Returns the underlying socket, primarily intended for testing purposes.- Returns:
- the underlying socket, or
nullif there is none
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-