class ExecutionTask implements ITask {

    @Override
    public void execute() throws TaskExecutionException {
        taskDispatcher.notifyThreadStart();

        try {
            while (taskDispatcher.getExecutionTask() == this) {
                if (Thread.interrupted()) {
                    Thread.currentThread().interrupt();
                    return;
                }

                ITask task = taskDispatcher.getTaskQueue().tryTake();

                if (null == task) {
                    return;
                }

                taskDispatcher.notifyTaskTaken();

                taskDispatcher.getThreadPool().tryExecute(this);

                task.execute();
            }

            taskDispatcher.getThreadPool().tryExecute(taskDispatcher.getExecutionTask());
        } finally {
            taskDispatcher.notifyThreadStop();
        }
    }

      ExecutionTask(final TaskDispatcher taskDispatcher);

}