Class DynamicOutputFromStream
java.lang.Object
org.aksw.vshell.registry.OutputBase
org.aksw.vshell.registry.DynamicOutputFromStream
- All Implemented Interfaces:
Closeable, AutoCloseable, DynamicOutput, Output
Dynamically add a pipe that other processes can write to.
Note right now an upgrade to a pipe sends all writes to the pipe.
Actually we can still write directly to the sink.
The point is, that the pipe acts as an additional endpoint for writing
to the actual output stream.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected OutputStreamprotected Objectprotected PosixPipeprotected CompletableFuture<?> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()getFile()Return a pipe.booleanhasFile()static DynamicOutputFromStreamof(OutputStream coreOutput) protected voidupgrade()Methods inherited from class OutputBase
flush, getWriterCharset, hasPrinter, hasWriter, outputStream, printStream, printStream, writer, writerMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Output
flush, getWriterCharset, hasPrinter, hasWriter, outputStream, printStream, printStream, writer, writer
-
Field Details
-
coreOutput
-
pipe
-
pumpFuture
-
lock
-
-
Constructor Details
-
DynamicOutputFromStream
-
-
Method Details
-
openOutputStream
- Specified by:
openOutputStreamin classOutputBase- Throws:
IOException
-
of
-
hasFile
public boolean hasFile()- Specified by:
hasFilein interfaceDynamicOutput
-
getFile
Description copied from interface:DynamicOutputReturn a pipe. It may be created on-demand, hence the IOException.- Specified by:
getFilein interfaceDynamicOutput- Throws:
IOException
-
upgrade
- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputBase- Throws:
IOException
-