Package eu.bandm.tools.message
Class SingleSender<M extends Message>
java.lang.Object
eu.bandm.tools.message.SingleSender<M>
- Type Parameters:
M
- the message subtype propagated by this sender
- Direct Known Subclasses:
MessageAsync
,MessageCatcher
,MessageKindFilter
,MessageLocationFilter
,MessageMapper
,MessagePasser
,MessageStripExceptions
,MessageSync
,SimpleMessage.LocationMapper
,SimpleMessage.Sender
Common superclass of all which send messages to one single drain.
This includes some "genuine message sources", ie. senders only, but most of the subclasses are
This drain can be enquired and set, ie. it can change dynamically during execution. Intentionally, the code will crash if a
This includes some "genuine message sources", ie. senders only, but most of the subclasses are
MessageReceiver
s, which pass on
the received messages to one single drain. This drain can be enquired and set, ie. it can change dynamically during execution. Intentionally, the code will crash if a
receiver==null
and a send is attempted-
Field Summary
Modifier and TypeFieldDescriptionprotected @Opt MessageReceiver<? super M>
Whereto the messages are passed. -
Constructor Summary
ModifierConstructorDescriptionprotected
After calling this constructor, a call tosetReceiver(MessageReceiver)
is necessary before you can usesend(Message)
.protected
SingleSender
(@Opt MessageReceiver<? super M> r) Constructor which setsreceiver
. -
Method Summary
Modifier and TypeMethodDescription@Opt MessageReceiver<? super M>
Evidentprotected void
Used to pass on a message to the currentreceiver
.void
setReceiver
(@Opt MessageReceiver<? super M> r) Evident
-
Field Details
-
receiver
Whereto the messages are passed.
-
-
Constructor Details
-
SingleSender
protected SingleSender()After calling this constructor, a call tosetReceiver(MessageReceiver)
is necessary before you can usesend(Message)
. Otherwise code will crash intentionally. -
SingleSender
Constructor which setsreceiver
.
-
-
Method Details
-
setReceiver
Evident -
getReceiver
Evident -
send
Used to pass on a message to the currentreceiver
.
Intentionally, the code will crash if this is==null
-