public class MessageCatcher extends SingleSender<Message> implements Runnable
Runnable and
given as constructor argument, or (2) be re-defining code()
in a derived class.run() to start execution.Messages are sent directly to the
MessageReceiver in SingleSender.receiver. All other
Exception are wrapped into a SimpleMessageof kind
failure.Errors are not caught.| Modifier and Type | Field and Description |
|---|---|
protected Exception |
caught |
protected Runnable |
runnable |
receiver| Constructor and Description |
|---|
MessageCatcher(MessageReceiver<Message> rec)
When using this constructor, you have to re-define teh method
code(). |
MessageCatcher(Runnable c,
MessageReceiver<Message> rec) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
code()
Redefine this method, or set the value of
runnable via constructor
call. |
Exception |
getCaught()
returns the last throwable caught, if any.
|
void |
run() |
getReceiver, send, setReceiverpublic MessageCatcher(Runnable c, MessageReceiver<Message> rec)
public MessageCatcher(MessageReceiver<Message> rec)
code().
Otherwise code will crash intentionally.see also the complete user documentation .