Class AbstractMagicBytesTransmissionDispatcher<CHILD extends Transmission>

java.lang.Object
org.refcodes.serial.AbstractMagicBytesTransmissionDispatcher<CHILD>
All Implemented Interfaces:
Serializable, Iterable<CHILD>, org.refcodes.mixin.ChildrenAccessor<CHILD[]>, org.refcodes.mixin.LengthAccessor, Transmission
Direct Known Subclasses:
MagicBytesSectionDispatcher, MagicBytesSegmentDispatcher

public class AbstractMagicBytesTransmissionDispatcher<CHILD extends Transmission>
extends Object
implements Transmission, Iterable<CHILD>, org.refcodes.mixin.ChildrenAccessor<CHILD[]>
The AbstractMagicBytesTransmissionDispatcher 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:
Serialized Form