Interface ListenerExceptionHandler<K,E,O>
- Type Parameters:
K- the key typeE- the event typeO- the order type
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
An interface to handle the exception that is thrown from
SubscribedListener.consumer().-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumThe operations that indicates what theEventCallershould do next -
Method Summary
Modifier and TypeMethodDescriptionstatic <K,E, O> @NotNull ListenerExceptionHandler<K, E, O> Creates aListenerExceptionHandlerthat returnsListenerExceptionHandler.Result.CONTINUE.@NotNull ListenerExceptionHandler.ResulthandleException(E event, @NotNull SubscribedListener<K, ? extends E, O> listener, @NotNull Throwable exception) Handles the exception.
-
Method Details
-
continueHandler
Creates aListenerExceptionHandlerthat returnsListenerExceptionHandler.Result.CONTINUE.- Type Parameters:
K- the key typeE- the event typeO- the order type- Returns:
- a
ListenerExceptionHandlerthat returnsListenerExceptionHandler.Result.CONTINUE
-
handleException
@NotNull @NotNull ListenerExceptionHandler.Result handleException(@NotNull E event, @NotNull @NotNull SubscribedListener<K, ? extends E, O> listener, @NotNull @NotNull Throwable exception) Handles the exception.- Parameters:
event- the event instancelistener- theSubscribedListenerthat throws an exceptionexception- the thrown exception- Returns:
- the
ListenerExceptionHandler.Resultthat indicates what theEventCallershould do next
-