public enum PropagatingErrorHandler extends Enum<PropagatingErrorHandler> implements ErrorHandler, ListenerInvocationErrorHandler
Enum Constant and Description |
---|
INSTANCE
Singleton instance of a
PropagatingErrorHandler . |
Modifier and Type | Method and Description |
---|---|
void |
handleError(ErrorContext errorContext)
Handle an error raised during event processing.
|
static PropagatingErrorHandler |
instance()
Singleton instance of a
PropagatingErrorHandler . |
void |
onError(Exception exception,
EventMessage<?> event,
EventMessageHandler eventHandler)
Invoked after given
eventListener failed to handle given event . |
static PropagatingErrorHandler |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static PropagatingErrorHandler[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final PropagatingErrorHandler INSTANCE
PropagatingErrorHandler
.public static PropagatingErrorHandler[] values()
for (PropagatingErrorHandler c : PropagatingErrorHandler.values()) System.out.println(c);
public static PropagatingErrorHandler valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static PropagatingErrorHandler instance()
PropagatingErrorHandler
.PropagatingErrorHandler
public void onError(@Nonnull Exception exception, @Nonnull EventMessage<?> event, @Nonnull EventMessageHandler eventHandler) throws Exception
ListenerInvocationErrorHandler
eventListener
failed to handle given event
. Implementations have a
choice of options for how to continue:
EventMessageHandler.handle(EventMessage)
on the eventListener once or multiple times.onError
in interface ListenerInvocationErrorHandler
exception
- The exception thrown by the given eventListenerevent
- The event that triggered the exceptioneventHandler
- The listener that failed to handle given eventException
- To stop further handling of the eventpublic void handleError(@Nonnull ErrorContext errorContext) throws Exception
ErrorHandler
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 given failedEvents
.
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.
handleError
in interface ErrorHandler
errorContext
- Contextual information describing the errorException
- if the handler decides to propagate the errorCopyright © 2010–2024. All rights reserved.