C
- The type of payload of the commandR
- The return value of the command handlerpublic class FailureLoggingCallback<C,R> extends Object implements CommandCallback<C,R>
CommandCallback
implementation wrapping another, that concisely logs failed commands. Since the full
exception is being reported to the delegate callback, the full stacktrace is not logged.Constructor and Description |
---|
FailureLoggingCallback(CommandCallback<C,R> delegate)
Initialize the callback to delegate calls to the given
delegate , logging failures on a logger
for this class (on warn level). |
FailureLoggingCallback(org.slf4j.Logger logger,
CommandCallback<C,R> delegate)
Initialize the callback to delegate calls to the given
delegate , logging failures on the given
logger (on warn level). |
Modifier and Type | Method and Description |
---|---|
void |
onResult(CommandMessage<? extends C> commandMessage,
CommandResultMessage<? extends R> commandResultMessage)
Invoked when command handling execution is completed.
|
public FailureLoggingCallback(CommandCallback<C,R> delegate)
delegate
, logging failures on a logger
for this class (on warn level).delegate
- The command callback to forward invocations topublic FailureLoggingCallback(org.slf4j.Logger logger, CommandCallback<C,R> delegate)
delegate
, logging failures on the given
logger
(on warn level).logger
- The logger to log exceptions ondelegate
- The command callback to forward invocations topublic void onResult(CommandMessage<? extends C> commandMessage, CommandResultMessage<? extends R> commandResultMessage)
CommandCallback
onResult
in interface CommandCallback<C,R>
commandMessage
- the CommandMessage
that was dispatchedcommandResultMessage
- the CommandResultMessage
of the command handling executionCopyright © 2010–2018. All rights reserved.