接口 ThreadPoolBuilder.TaskExceptionListener

  • 封闭类:
    ThreadPoolBuilder

    public static interface ThreadPoolBuilder.TaskExceptionListener
    Listener that receive the exception of failed task. Note that this do not change the exception handler of the ThreadPool, or the Thread that run the task.
    • 方法概要

      所有方法 实例方法 抽象方法 
      修饰符和类型 方法 说明
      void onException​(java.lang.Runnable runnable, java.lang.Throwable throwable)
      Get called when task exception throw, passing a runnable task, and the exception.
    • 方法详细资料

      • onException

        void onException​(java.lang.Runnable runnable,
                         java.lang.Throwable throwable)
        Get called when task exception throw, passing a runnable task, and the exception. If this method throw exception, the thread will be die.
        参数:
        runnable - the task. If the task is submit using Executor.execute(Runnable), this is the runnable it'self; If the task is submit using ExecutorService.submit(Runnable), or ExecutorService.submit(Callable), this is a FutureTask Object wrapping the original Callable/Runnable.
        throwable - the exception thrown by task