1 | Define an event ADataReadyEvent with A as source and B as combined sink and listener |
2 | A defines an instance Evtcontrol of ADataReadyEvent which has a method transferdata |
3 | B instantiates an object Bcallback implementing interface ADataReadyListener with a method readytogo() |
4 | B registers this listener object as a callback with A |
5 | When A is ready to send data to B, A callbacks Bcallback.readtogo(ADataReadyEvent Evtcontrol) |
6 | B calls back Evtcontrol.transferdata(sink information) |
7 | Note that "control" mechanism uses powerful JavaBean approach (this is handshake) whereas one can use a totally different and faster approach to actually send data |
8 | Traditional (in my world) mechanisms combine control and data transfer |