Package eu.bandm.tools.message
Class MessageStripExceptions<M extends Message>
java.lang.Object
eu.bandm.tools.message.SingleSender<M>
eu.bandm.tools.message.MessagePasser<M>
eu.bandm.tools.message.MessageStripExceptions<M>
- Type Parameters:
M
- the type of the messages
- All Implemented Interfaces:
MessageReceiver<M>
A filter which strips off all exceptions, or at least their stack traces.
The Message object and the contained Exception object are altered,
which may affect parallel references.
Is useful for a slimmer appearance of print-outs.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final StackTraceElement[]
Is used for replacement when stripping the stack trace.protected boolean
Whether exceptions are stripped off totally.Fields inherited from class eu.bandm.tools.message.SingleSender
drain
-
Constructor Summary
ConstructorsConstructorDescriptionMessageStripExceptions
(@Opt MessageReceiver<? super M> d, boolean total) Only constructor. -
Method Summary
Methods inherited from class eu.bandm.tools.message.SingleSender
getDrain, getReceiver, send, setDrain, setReceiver
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface eu.bandm.tools.message.MessageReceiver
ifSubcriticalThen, ifSubcriticalThen, ifSubcriticalThenElse
-
Field Details
-
total
protected boolean totalWhether exceptions are stripped off totally. If false: only their stack trace is removed. -
emptyStackTrace
Is used for replacement when stripping the stack trace.
-
-
Constructor Details
-
MessageStripExceptions
Only constructor.- Parameters:
d
- the target of this filtertotal
- whether exceptions are stripped off totally, or only their stack trace.
-
-
Method Details
-
receive
Propagate the message after removing the exception (total=true) or only its stack trace. The Message object and the contained Exception object are altered, which may affect parallel references.- Specified by:
receive
in interfaceMessageReceiver<M extends Message>
- Overrides:
receive
in classMessagePasser<M extends Message>
- Parameters:
m
- the message to receive.
-