public abstract class SingleSender<M extends Message> extends Object
MessageReceiver
s, which pass on
the received messages to one single drain. receiver==null
and a send is attemptedModifier and Type | Field and Description |
---|---|
protected MessageReceiver<? super M> |
receiver |
Constructor and Description |
---|
SingleSender()
After calling this constructor, a call to
setReceiver(MessageReceiver)
is necessary before you can use send(Message) . |
SingleSender(MessageReceiver<? super M> r) |
Modifier and Type | Method and Description |
---|---|
MessageReceiver<? super M> |
getReceiver() |
protected void |
send(M m)
Used to pass on a message to the current
receiver . |
void |
setReceiver(MessageReceiver<? super M> r) |
protected MessageReceiver<? super M extends Message> receiver
public SingleSender()
setReceiver(MessageReceiver)
is necessary before you can use send(Message)
.
Otherwise code will crash intentionally.public SingleSender(MessageReceiver<? super M> r)
public void setReceiver(MessageReceiver<? super M> r)
public MessageReceiver<? super M> getReceiver()
see also the complete user documentation .