Class ExceptionHandlerWrapper<T>

  • Type Parameters:
    T - The data type of the underlying RingBuffer
    All Implemented Interfaces:
    ExceptionHandler<T>

    public class ExceptionHandlerWrapper<T>
    extends java.lang.Object
    implements ExceptionHandler<T>
    A mutable exception handler wrapper
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void handleEventException​(java.lang.Throwable ex, long sequence, T event)
      Strategy for handling uncaught exceptions when processing an event.
      void handleOnShutdownException​(java.lang.Throwable ex)
      Callback to notify of an exception during EventHandlerBase.onShutdown()
      void handleOnStartException​(java.lang.Throwable ex)
      Callback to notify of an exception during EventHandlerBase.onStart()
      void switchTo​(ExceptionHandler<? super T> exceptionHandler)
      Switch to a different exception handler
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ExceptionHandlerWrapper

        public ExceptionHandlerWrapper()
    • Method Detail

      • switchTo

        public void switchTo​(ExceptionHandler<? super T> exceptionHandler)
        Switch to a different exception handler
        Parameters:
        exceptionHandler - the exception handler to use from now on
      • handleEventException

        public void handleEventException​(java.lang.Throwable ex,
                                         long sequence,
                                         T event)
        Description copied from interface: ExceptionHandler

        Strategy for handling uncaught exceptions when processing an event.

        If the strategy wishes to terminate further processing by the BatchEventProcessor then it should throw a RuntimeException.

        Specified by:
        handleEventException in interface ExceptionHandler<T>
        Parameters:
        ex - the exception that propagated from the EventHandler.
        sequence - of the event which cause the exception.
        event - being processed when the exception occurred. This can be null.
      • handleOnStartException

        public void handleOnStartException​(java.lang.Throwable ex)
        Description copied from interface: ExceptionHandler
        Callback to notify of an exception during EventHandlerBase.onStart()
        Specified by:
        handleOnStartException in interface ExceptionHandler<T>
        Parameters:
        ex - throw during the starting process.
      • handleOnShutdownException

        public void handleOnShutdownException​(java.lang.Throwable ex)
        Description copied from interface: ExceptionHandler
        Callback to notify of an exception during EventHandlerBase.onShutdown()
        Specified by:
        handleOnShutdownException in interface ExceptionHandler<T>
        Parameters:
        ex - throw during the shutdown process.