Package eu.bandm.tools.message
Class MessageStripExceptions<M extends Message>
java.lang.Object
eu.bandm.tools.message.SingleSender<M>
eu.bandm.tools.message.MessageStripExceptions<M>
- All Implemented Interfaces:
MessageReceiver<M>
public class MessageStripExceptions<M extends Message>
extends SingleSender<M>
implements MessageReceiver<M>
A filter which strips off all exceptions, or at least the stack traces,
for a slimmer appearance of print-outs.
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final StackTraceElement[]
protected boolean
Whether exceptions are stripped off totally.Fields inherited from class eu.bandm.tools.message.SingleSender
receiver
-
Constructor Summary
ConstructorDescriptionMessageStripExceptions
(MessageReceiver<? super M> d, boolean total) Only constructor. -
Method Summary
Methods inherited from class eu.bandm.tools.message.SingleSender
getReceiver, send, setReceiver
-
Field Details
-
total
protected boolean totalWhether exceptions are stripped off totally. If false: only their stack trace. -
emptyStackTrace
-
-
Constructor Details
-
MessageStripExceptions
Only constructor.- Parameters:
total
- whether exceptions are stripped off totally, or only their stack trace.
-
-
Method Details
-
receive
Pass on the message after removing the exception (total=true) or replacing it with a clone without stack trace. Please note that the Message object and the Exception object are altered, which may affect parallel references.- Specified by:
receive
in interfaceMessageReceiver<M extends Message>
-