001 package biz.hammurapi.dataflow; 002 003 /** 004 * Data sinks consume data. 005 * @author Pavel 006 */ 007 public interface DataSink { 008 009 // Name? 010 011 /** 012 * @return true if this sink controls multiplexing to "sibling" sinks, 013 * i.e. if addData() can return true. 014 */ 015 boolean controlsMultiplexing(); 016 017 /** 018 * @return Information about data items expected/required by the sink. 019 */ 020 DataItemInfo[] getDataInfo(); 021 022 /** 023 * Adds data to the sink. 024 * @param data 025 * @return true if data was "consumed" and shall be removed from further processing. 026 * If this sink is attached to a multiplexor, then the multiplexor shall not 027 * continue adding given data to "sibling" sinks. 028 */ 029 boolean addData(Data data); 030 }