1、线程池的顶级接口(Executor)
线程池的顶级接口(jdk > 1.5)。仅仅定义了方法execute(Runnable)。
该方法接收一个Runnable实例,用来执行一个任务,该任务即是一个实现Runnable接口的类。
public interface Executor { /** * Executes the given command at some time in the future. The command * may execute in a new thread, in a pooled thread, or in the calling * thread, at the discretion of the <tt>Executor</tt> implementation. * * @param command the runnable task * @throws RejectedExecutionException if this task cannot be * accepted for execution. * @throws NullPointerException if command is null */ void execute(Runnable command); }