Class MagicBytesSectionMultiplexer

All Implemented Interfaces:
Serializable, Iterable<Section>, org.refcodes.mixin.ChildrenAccessor<Section[]>, org.refcodes.mixin.LengthAccessor, org.refcodes.mixin.Schemable<SerialSchema>, Section, Transmission

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