Class AbstractMagicBytesTransmissionMultiplexer<CHILD extends Transmission>

java.lang.Object
org.refcodes.serial.AbstractMagicBytesTransmissionMultiplexer<CHILD>
All Implemented Interfaces:
Serializable, Iterable<CHILD>, org.refcodes.mixin.ChildrenAccessor<CHILD[]>, org.refcodes.mixin.LengthAccessor, org.refcodes.mixin.Schemable<SerialSchema>, Transmission
Direct Known Subclasses:
MagicBytesSectionMultiplexer, MagicBytesSegmentMultiplexer

public class AbstractMagicBytesTransmissionMultiplexer<CHILD extends Transmission> extends Object implements Transmission, Iterable<CHILD>, org.refcodes.mixin.ChildrenAccessor<CHILD[]>
The AbstractMagicBytesTransmissionMultiplexer dispatches a transmission to one of the aggregated Transmission instances depending on the magic number provided by the transmission. A transmission is passed to each of the aggregated Transmission instances till one Transmission accepts the transmission, e.g. until a Transmission does not throw a BadMagicBytesException. Attention: A Transmission throwing a TransmissionException other than a BadMagicBytesException is considered to be responsible for the transmission so that dispatching is *not* continued with the succeeding Transmission! The last Transmission which was responsible for a transmission's magic bytes will be the responsible Transmission till another Transmission claims responsibility for a transmsision's magic bytes. Initially the first Transmission passed to this instance is the responsible Transmission.
See Also: