Package ai.libs.jaicore.ml.scikitwrapper
Class AProcessListener
- java.lang.Object
-
- ai.libs.jaicore.ml.scikitwrapper.AProcessListener
-
- All Implemented Interfaces:
IProcessListener
- Direct Known Subclasses:
DefaultProcessListener
public abstract class AProcessListener extends java.lang.Object implements IProcessListener
The process listener may be attached to a process in order to handle its ouputs streams in a controlled way. For instance, the process listener can be used to pipe all outputs of the invoked process to a logger system.
-
-
Constructor Summary
Constructors Constructor Description AProcessListener()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidhandleError(java.lang.String error)Handle the output of the error output stream.abstract voidhandleInput(java.lang.String input)Handle the output of the standard output stream.voidlistenTo(java.lang.Process process)Lets the process listener listen to the output and error stream of the given process.
-
-
-
Method Detail
-
listenTo
public void listenTo(java.lang.Process process) throws java.io.IOException, java.lang.InterruptedExceptionDescription copied from interface:IProcessListenerLets the process listener listen to the output and error stream of the given process.- Specified by:
listenToin interfaceIProcessListener- Parameters:
process- The process to be listened to.- Throws:
java.io.IOExceptionjava.lang.InterruptedException
-
handleError
public abstract void handleError(java.lang.String error) throws java.io.IOException, java.lang.InterruptedExceptionHandle the output of the error output stream.- Parameters:
error- The line sent by the process via the error stream.- Throws:
java.io.IOException- An IOException is thrown if there is an issue reading from the process's stream.java.lang.InterruptedException- An interrupted exception is thrown if the thread/process is interrupted while processing the error messages.
-
handleInput
public abstract void handleInput(java.lang.String input) throws java.io.IOException, java.lang.InterruptedExceptionHandle the output of the standard output stream.- Parameters:
error- The line sent by the process via the standard output stream.- Throws:
java.io.IOException- An IOException is thrown if there is an issue reading from the process's stream.java.lang.InterruptedException- An interrupted exception is thrown if the thread/process is interrupted while processing the standard output messages.
-
-