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
ConstructorDescriptionInstance
(ExternalProblem.Builder builder) Constructs an instance of an external problem. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
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.boolean
Returnstrue
if the underlying process or connections are established;false
otherwise.void
start()
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()Returnstrue
if the underlying process or connections are established;false
otherwise.- Returns:
true
if the underlying process or connections are established;false
otherwise
-
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
null
if there is none
-
getSocket
Returns the underlying socket, primarily intended for testing purposes.- Returns:
- the underlying socket, or
null
if there is none
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-