* @param $responseInstance An instance of a class with an Responseable interface
* @return void
* @throws FilterChainException If we need to interrupt the filter chain
- * @todo 0% done
+ * @todo 5% done
*/
public function execute (Requestable $requestInstance, Responseable $responseInstance) {
// Get cruncher instance
// Get a new task handler instance
$handlerInstance = ObjectFactory::createObjectByConfiguredName('task_handler_class');
+ // Register all tasks:
+ //
+ // 1) A task for fetching WUs (work units) or test units
+ $taskInstance = ObjectFactory::createObjectByConfiguredName('cruncher_work_unit_fetcher_task_class');
+ $handlerInstance->registerTask('cruncher_work_unit_fetcher', $taskInstance);
+
+ /*
+ * 2) A task for generating test units, a if() block could be placed
+ * around this but that would make this method look a little ugly and
+ * even more when more "temporary" tasks should be registered.
+ */
+ $taskInstance = ObjectFactory::createObjectByConfiguredName('cruncher_test_unit_producer_task_class');
+ $handlerInstance->registerTask('cruncher_test_unit_producer', $taskInstance);
+
+ /*
+ * 3) A task for generating keys based on the generated test unit. This
+ * task will only be executed if the state of the cruncher is one of
+ * these: 'virgin'.
+ */
+ $taskInstance = ObjectFactory::createObjectByConfiguredName('cruncher_key_producer_task_class');
+ $handlerInstance->registerTask('cruncher_key_producer', $taskInstance);
+
// Put the task handler in registry
Registry::getRegistry()->addInstance('task', $handlerInstance);
}