protected function executeTasks( array $tasks )
    {
        foreach ( $tasks as $scheduled => $taskList )
        {
            foreach ( $taskList as $cronjob )
            {
                if ( ( $task = $this->taskFactory->factory( $cronjob->task, $scheduled, $this->logger ) ) !== false )
                {
                    $this->logger->setTask( $task->getId() );
                    $this->logger->log( 'Start task execution.' );
                    $status = $task->execute();

                    switch ( $status )
                    {
                        case Executor::SUCCESS:
                            $this->logger->log( 'Finished task execution.' );
                            break;
                        case Executor::ERROR:
                            $this->logger->log( 'Error occured during task execution.', Logger::WARNING );
                            break;
                        case Executor::RESCHEDULE:
                            $this->logger->log( 'Task will be rescheduled for ' . $task->reScheduleTime . ' seconds.' );
                            $this->rescheduled[$scheduled + $task->reScheduleTime] = $cronjob;
                            break;
                        default:
                            $this->logger->log( 'Invalid status returned by task.', Logger::ERROR );
                            break;
                    }

                    $this->logger->setTask();
                }
            }
        }
    }