org.qi4j.io
Interface Output<T,ReceiverThrowableType extends java.lang.Throwable>


public interface Output<T,ReceiverThrowableType extends java.lang.Throwable>

Output for data.


Method Summary
<SenderThrowableType extends java.lang.Throwable>
void
receiveFrom(Sender<? extends T,SenderThrowableType> sender)
          This initiates a transfer from an Input.
 

Method Detail

receiveFrom

<SenderThrowableType extends java.lang.Throwable> void receiveFrom(Sender<? extends T,SenderThrowableType> sender)
                 throws ReceiverThrowableType extends java.lang.Throwable,
                        SenderThrowableType extends java.lang.Throwable
This initiates a transfer from an Input. Implementations should open any resources to be written to and then call sender.sendTo() when it is ready to receive data. When sendTo() returns the resource should be closed properly. Make sure to handle any exceptions from sendTo.

Type Parameters:
SenderThrowableType - the exception that sendTo can throw
Parameters:
sender - the sender of data to this output
Throws:
SenderThrowableType - the exception that the sender can throw
ReceiverThrowableType - the exception that this output can throw from receiveItem()
ReceiverThrowableType extends java.lang.Throwable