Package org.axonframework.eventhandling
Enum Class PropagatingErrorHandler
- All Implemented Interfaces:
Serializable,Comparable<PropagatingErrorHandler>,Constable,ErrorHandler,ListenerInvocationErrorHandler
public enum PropagatingErrorHandler
extends Enum<PropagatingErrorHandler>
implements ErrorHandler, ListenerInvocationErrorHandler
Singleton ErrorHandler implementation that does not do anything.
- Author:
- Rene de Waele
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionvoidhandleError(ErrorContext errorContext) Handle an error raised during event processing.static PropagatingErrorHandlerinstance()Singleton instance of aPropagatingErrorHandler.voidonError(Exception exception, EventMessage<?> event, EventMessageHandler eventHandler) Invoked after giveneventListenerfailed to handle givenevent.static PropagatingErrorHandlerReturns the enum constant of this class with the specified name.static PropagatingErrorHandler[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INSTANCE
Singleton instance of aPropagatingErrorHandler.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
instance
Singleton instance of aPropagatingErrorHandler.- Returns:
- the singleton instance of
PropagatingErrorHandler
-
onError
public void onError(@Nonnull Exception exception, @Nonnull EventMessage<?> event, @Nonnull EventMessageHandler eventHandler) throws Exception Description copied from interface:ListenerInvocationErrorHandlerInvoked after giveneventListenerfailed to handle givenevent. Implementations have a choice of options for how to continue:- To ignore this error no special action is required. Processing will continue for this and subsequent events.
- To retry processing the event, implementations can re-invoke
EventMessageHandler.handle(EventMessage)on the eventListener once or multiple times. - To terminate event handling altogether and stop propagating the event to other listeners implementations may throw an exception.
- Specified by:
onErrorin interfaceListenerInvocationErrorHandler- Parameters:
exception- The exception thrown by the given eventListenerevent- The event that triggered the exceptioneventHandler- The listener that failed to handle given event- Throws:
Exception- To stop further handling of the event
-
handleError
Description copied from interface:ErrorHandlerHandle an error raised during event processing. Generally this means that the UnitOfWork created to coordinate the event processing was rolled back. Using default configuration the ErrorHandler is only invoked when there is a serious error, for instance when the database transaction connected to the UnitOfWork can not be committed.The error handler has the option to simply log or ignore the error. Depending on the type of EventProcessor this will put an end to the processing of any further events (in case of a
TrackingEventProcessor) or simply skip over the list of givenfailedEvents.Note that although the UnitOfWork and hence any related database transactions have been rolled back when the error handler is invoked, the processing of one or more of the failedEvents may in fact have caused other side effects which could not be reverted.
- Specified by:
handleErrorin interfaceErrorHandler- Parameters:
errorContext- Contextual information describing the error- Throws:
Exception- if the handler decides to propagate the error
-