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)
Deprecated.
Please use
CommandCallback.wrap(CommandCallback) to wrap a command with a delegate and use
the FailureLoggingCallback(org.slf4j.Logger, org.axonframework.commandhandling.CommandCallback<C, R>) to create this callback |
FailureLoggingCallback(org.slf4j.Logger logger)
Initialize the callback to log failures on the given
logger (on warn level). |
FailureLoggingCallback(org.slf4j.Logger logger,
CommandCallback<C,R> delegate)
Deprecated.
Please use
CommandCallback.wrap(CommandCallback) to wrap a command with a delegate and use
the FailureLoggingCallback(Logger) to specify you custom logger. |
Modifier and Type | Method and Description |
---|---|
void |
onResult(CommandMessage<? extends C> commandMessage,
CommandResultMessage<? extends R> commandResultMessage)
Invoked when command handling execution is completed.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
wrap
public FailureLoggingCallback(org.slf4j.Logger logger)
logger
(on warn level).logger
- The logger to log exceptions on@Deprecated public FailureLoggingCallback(CommandCallback<C,R> delegate)
CommandCallback.wrap(CommandCallback)
to wrap a command with a delegate and use
the FailureLoggingCallback(org.slf4j.Logger, org.axonframework.commandhandling.CommandCallback<C, R>)
to create this callbackdelegate
, logging failures on a logger
for this class (on warn level).delegate
- The command callback to forward invocations to@Deprecated public FailureLoggingCallback(@Nonnull org.slf4j.Logger logger, @Nonnull CommandCallback<C,R> delegate)
CommandCallback.wrap(CommandCallback)
to wrap a command with a delegate and use
the FailureLoggingCallback(Logger)
to specify you custom logger.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(@Nonnull CommandMessage<? extends C> commandMessage, @Nonnull 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–2024. All rights reserved.