Java ThreadPoolExecutor 的 beforeExecute() 中的参数 class

Java the parameters in beforeExecute() of ThreadPoolExecutor class

ThreadPoolExecutorclass中beforeExecute()的参数为ThreadRunnable.

有时我们可能需要覆盖这个方法来满足我们的需要。

但是,当我在执行器中提交一些 callable 任务时。这里,在beforeExecute()中我们只能得到Runnable对象,所以我想知道执行者是否将可调用形式隐式转换为可运行???

我在 Executors class 中找到了一些实用方法,它们将 Runnable 转换为 Callable,但我没有找到相反的东西。

呼叫 submit(Callable) calls newTaskFor(), which returns a Runnable calling the Callable. And that Runnable is then passed to execute().