Class IgnoreEventDeliveryExceptionHandler
- java.lang.Object
-
- io.eventuate.javaclient.eventhandling.exceptionhandling.IgnoreEventDeliveryExceptionHandler
-
- All Implemented Interfaces:
EventDeliveryExceptionHandler
public class IgnoreEventDeliveryExceptionHandler extends java.lang.Object implements EventDeliveryExceptionHandler
An exception handler that ignores the specified exceptions
-
-
Constructor Summary
Constructors Constructor Description IgnoreEventDeliveryExceptionHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidhandle(EventDeliveryExceptionHandlerState state, java.lang.Throwable t, java.lang.Runnable retry, java.util.function.Consumer<java.lang.Throwable> fail, java.lang.Runnable ignore)handle an exception by either (asynchronously) retrying or failingbooleanhandles(java.lang.Throwable t)Returns true if this handles the throwableEventDeliveryExceptionHandlerStatemakeState(java.lang.Throwable t)create the state used for handling an exceptionIgnoreEventDeliveryExceptionHandlerwithExceptions(java.lang.Class<? extends java.lang.Throwable>... throwables)Specifies the exceptions that this exception handler can handle
-
-
-
Method Detail
-
handles
public boolean handles(java.lang.Throwable t)
Description copied from interface:EventDeliveryExceptionHandlerReturns true if this handles the throwable- Specified by:
handlesin interfaceEventDeliveryExceptionHandler- Parameters:
t- the throwable- Returns:
- true if handled, false otherwise
-
makeState
public EventDeliveryExceptionHandlerState makeState(java.lang.Throwable t)
Description copied from interface:EventDeliveryExceptionHandlercreate the state used for handling an exception- Specified by:
makeStatein interfaceEventDeliveryExceptionHandler- Parameters:
t- the throwable- Returns:
- the state used by the handler
-
handle
public void handle(EventDeliveryExceptionHandlerState state, java.lang.Throwable t, java.lang.Runnable retry, java.util.function.Consumer<java.lang.Throwable> fail, java.lang.Runnable ignore)
Description copied from interface:EventDeliveryExceptionHandlerhandle an exception by either (asynchronously) retrying or failing- Specified by:
handlein interfaceEventDeliveryExceptionHandler- Parameters:
state- the statet- the throwableretry- invoked asynchronously to retryfail- invoked asynchronously to failignore- invoked to ignore the exception
-
withExceptions
@SafeVarargs public final IgnoreEventDeliveryExceptionHandler withExceptions(java.lang.Class<? extends java.lang.Throwable>... throwables)
Specifies the exceptions that this exception handler can handle- Parameters:
throwables- the exceptions- Returns:
- this
-
-