@Override public void execute(Runnable command) { if (command == null) { throw new NullPointerException("command can't be null"); } if (!live) { throw new RejectedExecutionException("Executor is terminated!"); } Worker worker = getWorker(command); worker.schedule(command); }
@Override public void execute(Runnable task) { checkNotNull(task, "task can't be null"); if (!live) { throw new RejectedExecutionException("Executor is terminated!"); } Worker worker = getWorker(task); worker.schedule(task); }