public class SimpleExecutor implements Executor ...{
public void execute(Runnable r) ...{
r.run();①在提交时直接运行任务
}
}
class ThreadPerTaskExecutor implements Executor ...{
public void execute(Runnable r) ...{
new Thread(r).start();①在新的执行线程中执行任务
}
}
| 第1页: 概述 | 第2页: Executor接口 |
| 第3页: Spring对Executor所提供的抽象 |