public class RecordingListenerInvocationErrorHandler extends Object implements org.axonframework.eventhandling.ListenerInvocationErrorHandler
ListenerInvocationErrorHandler that in itself also implements
ListenerInvocationErrorHandler. Any Exception encountered will be stored, after which the rest of the error
handling will be handed off to the wrapped ListenerInvocationErrorHandler.| Constructor and Description |
|---|
RecordingListenerInvocationErrorHandler(org.axonframework.eventhandling.ListenerInvocationErrorHandler listenerInvocationErrorHandler)
Create a new instance of this class, wrapping another
ListenerInvocationErrorHandler. |
| Modifier and Type | Method and Description |
|---|---|
void |
failOnErrorInPreparation(boolean failOnErrorInPreparation)
Configure whether this error handler should fail on errors in the preparation phase.
|
Optional<Exception> |
getException()
Return the last encountered Exception after the startRecording method has been invoked, or an empty Optional of
no Exception occurred.
|
void |
onError(Exception exception,
org.axonframework.eventhandling.EventMessage<?> event,
org.axonframework.eventhandling.EventMessageHandler eventHandler) |
void |
setListenerInvocationErrorHandler(org.axonframework.eventhandling.ListenerInvocationErrorHandler listenerInvocationErrorHandler)
Sets a new wrapped
ListenerInvocationErrorHandler. |
void |
startRecording()
Start recording by clearing any current
Exception. |
public RecordingListenerInvocationErrorHandler(org.axonframework.eventhandling.ListenerInvocationErrorHandler listenerInvocationErrorHandler)
ListenerInvocationErrorHandler.listenerInvocationErrorHandler - The ListenerInvocationErrorHandler to invoke for the error
handling, cannot be null.public void onError(@Nonnull Exception exception, @Nonnull org.axonframework.eventhandling.EventMessage<?> event, @Nonnull org.axonframework.eventhandling.EventMessageHandler eventHandler) throws Exception
onError in interface org.axonframework.eventhandling.ListenerInvocationErrorHandlerExceptionpublic void startRecording()
Exception.public void setListenerInvocationErrorHandler(org.axonframework.eventhandling.ListenerInvocationErrorHandler listenerInvocationErrorHandler)
ListenerInvocationErrorHandler.listenerInvocationErrorHandler - The ListenerInvocationErrorHandler to invoke for the error
handling, cannot be null.public Optional<Exception> getException()
public void failOnErrorInPreparation(boolean failOnErrorInPreparation)
started yet.
When set to true will rethrow the exception, regardless of the configured
ListenerInvocationErrorHandler. Defaults to true.
failOnErrorInPreparation - A boolean dictating whether to rethrow if this recorder is not started.Copyright © 2010–2024. All rights reserved.