public interface Plumbable
extends java.lang.Runnable
Runnable
which wants to have
set an input stream to read from and/or an output stream to write to
before it is run.
It is expected, that classes implementing this interface will
read from an input stream, write to an output stream or do both in
their run()
method. The point of having the set-functions
instead of specifying the streams in the constructor of such a class
is that objects of the class can be created and passed around to
only later have the stream(s) sepcified.
Modifier and Type | Method and Description |
---|---|
java.lang.Exception |
getException()
returns an exception which happend in the
run() -method, if any. |
void |
setIn(java.io.InputStream in,
boolean closeOnExit) |
void |
setOut(java.io.OutputStream out,
boolean closeOnExit) |
void setOut(java.io.OutputStream out, boolean closeOnExit)
void setIn(java.io.InputStream in, boolean closeOnExit)
java.lang.Exception getException()
run()
-method, if any.
Because input and output may cause exceptions while
the run
-method can not throw anything, an implementing
class must have this function which allows it to return an
exception which might happen during run()
.