Class CountedErrorHandler

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Close so that onError(Throwable) will not delegate and instead print to System.err.
      boolean isClosed()
      Has this instance been closed.
      void onError​(java.lang.Throwable throwable)
      Callback to notify of an error that has occurred when processing an operation or event.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • isClosed

        private volatile boolean isClosed
    • Constructor Detail

      • CountedErrorHandler

        public CountedErrorHandler​(ErrorHandler errorHandler,
                                   AtomicCounter errorCounter)
        Construct a counted error handler with a delegate and counter.
        Parameters:
        errorHandler - to delegate to.
        errorCounter - to increment before delegation.
    • Method Detail

      • close

        public void close()
        Close so that onError(Throwable) will not delegate and instead print to System.err.
        Specified by:
        close in interface java.lang.AutoCloseable
      • isClosed

        public boolean isClosed()
        Has this instance been closed.
        Returns:
        true if close() has previously been called, otherwise false.
      • onError

        public void onError​(java.lang.Throwable throwable)
        Callback to notify of an error that has occurred when processing an operation or event.

        This method is assumed non-throwing, so rethrowing the exception or triggering further exceptions would be a bug.

        Specified by:
        onError in interface ErrorHandler
        Parameters:
        throwable - that occurred while processing an operation or event.