Package eu.bandm.tools.message
Class MessageDemux<E extends Enum<E>,M extends Message>
java.lang.Object
eu.bandm.tools.message.PrimitiveMessageDemux<E,M>
eu.bandm.tools.message.MessageDemux<E,M>
- All Implemented Interfaces:
MessageReceiver<M>
- Direct Known Subclasses:
MessageDemux.All
,MessageDemux.ByKind
public abstract class MessageDemux<E extends Enum<E>,M extends Message>
extends PrimitiveMessageDemux<E,M>
Auxiliary class which concretizes
PrimitiveMessageDemux
in so far
it calculates a set of enum values for every message it receives, and then
calls the PrimitiveMessageDemux.receive(Enum,Message)
method for all these.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Trivial instantiation ofMessageDemux
which propagates each message to all receivers in the map, as it has been constructed byPrimitiveMessageDemux.setReceiver(Enum,MessageReceiver)
static class
MessageDemux.ByKind<M extends Message>
AMessageDemux
which sorts messages by their kind. -
Field Summary
Fields inherited from class eu.bandm.tools.message.PrimitiveMessageDemux
outlets, tagclass
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <E extends Enum<E>,
M extends Message>
MessageDemux<E,M> Delivers a trivial instantiation ofMessageDemux
, seeMessageDemux.All
.static <M extends Message>
MessageDemux<Message.Kind,M> byKind()
factory method forMessageDemux.ByKind
getOutputTags
(M m) Has to be re-defined by derived classes to calculate the set of enum items which indicate the receivers the message shall be propagated to.void
Propagates the received message to all receivers indicated by the calculated enum item set.Methods inherited from class eu.bandm.tools.message.PrimitiveMessageDemux
getReceiver, receive, setReceiver
-
Constructor Details
-
MessageDemux
-
-
Method Details
-
getOutputTags
Has to be re-defined by derived classes to calculate the set of enum items which indicate the receivers the message shall be propagated to.
Only method which needs to be re-defined by a subclass to be operative. -
receive
Propagates the received message to all receivers indicated by the calculated enum item set.
CallsgetOutputTags(Message)
to calculate this set. -
all
Delivers a trivial instantiation ofMessageDemux
, seeMessageDemux.All
. -
byKind
factory method forMessageDemux.ByKind
-