|Re: [ecf-dev] Getting control over the input stream|
Jeff McAffer wrote:
ECF was designed to be asynchronous (non-blocking), and so introducing blocking/stream-based I/O wasn't the original API intention.
However, I think it would be straightforward to use PipedInputStreams (as the InputStream returned from some new wrapper class), and PipedOutputStream (the OutputStream passed to ECF in the IIncomingFileTransferReceiveStartEvent.receive(OutputStream) call. This way, ECF would asynchronously write to the given output stream as data are received and some other thread could read the connected PipedInputStream, and block when no data are available.
Such an API can be added to ECF, or to existing provisioning classes, if desired. Please file an enhancement request and we will address it.
But one thought: do you want to have the chain of processors be InputStream-based? Of course this means having ioexception/failure catching in code that may not be well-suited to handle it (e.g. transformers)...among other things.
I have two usecases