org.axonframework.saga.annotation
Class ProceedingErrorHandler

java.lang.Object
  extended by org.axonframework.saga.annotation.ProceedingErrorHandler
All Implemented Interfaces:
ErrorHandler

public class ProceedingErrorHandler
extends Object
implements ErrorHandler

ErrorHandler implementation that logs the error and proceeds with the next event.

Since:
2.4.2
Author:
Allard Buijze

Constructor Summary
ProceedingErrorHandler()
           
 
Method Summary
 RetryPolicy onErrorInvoking(Saga saga, EventMessage publishedEvent, int invocationCount, Exception e)
          Invoked when an error occurs when a Saga instance is invoked.
 RetryPolicy onErrorPreparing(Class<? extends Saga> sagaType, EventMessage<?> publishedEvent, int invocationCount, Exception e)
          Invoked when an error occurs preparing Sagas.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProceedingErrorHandler

public ProceedingErrorHandler()
Method Detail

onErrorPreparing

public RetryPolicy onErrorPreparing(Class<? extends Saga> sagaType,
                                    EventMessage<?> publishedEvent,
                                    int invocationCount,
                                    Exception e)
Description copied from interface: ErrorHandler
Invoked when an error occurs preparing Sagas. This is the phase where sagas are looked up using their associations.

Specified by:
onErrorPreparing in interface ErrorHandler
Parameters:
sagaType - The type of Saga to prepare
publishedEvent - The event being published
invocationCount - The number of attempts to prepare (is always at least 1)
e - The exception that occurred in this attempt
Returns:
the expected behavior for the event handling component

onErrorInvoking

public RetryPolicy onErrorInvoking(Saga saga,
                                   EventMessage publishedEvent,
                                   int invocationCount,
                                   Exception e)
Description copied from interface: ErrorHandler
Invoked when an error occurs when a Saga instance is invoked. These are errors thrown by the Saga itself.

Specified by:
onErrorInvoking in interface ErrorHandler
Parameters:
saga - The Saga instance being invoked
publishedEvent - The event handled by the Saga
invocationCount - The number of times this event has been offered to the Saga, including the last, failed, attempt
e - The exception that occurred in the last attempt to invoke the Saga
Returns:
The Policy describing what the SagaManager should do with this exception (retry, skip, etc)


Copyright © 2010-2016. All Rights Reserved.