/**
* Unregisters the given task
*
- * @param $taskName Name of the task
+ * @param $taskData Data of the task
* @return void
*/
- private function unregisterTask ($taskName) {
+ private function unregisterTask (array $taskData) {
+ // Debug output
+ $this->debugOutput('TASK-HANDLER: Removing task ' . $taskData['id'] . ' from queue - START');
+
// Remove the entry
- $this->getListInstance()->removeEntry('tasks', $taskName);
+ $this->getListInstance()->removeEntry('tasks', $taskData);
+
+ // Debug output
+ $this->debugOutput('TASK-HANDLER: Removing task ' . $taskData['id'] . ' from queue - FINISHED');
}
/**
// Remember all tasks that has been shutdown for removal
$tasks = array();
+ // Instance a visitor
+ $this->visitorInstance = ObjectFactory::createObjectByConfiguredName('shutdown_task_visitor_class');
+
// Shutdown all tasks in once go
while ($this->getIteratorInstance()->valid()) {
// Get current entry
$this->debugOutput('TASK-HANDLER: Shutting down task ' . $current['id'] . ' (taskInstance=' . $current['task_instance']->__toString() . ') ...');
// Shutdown the task
- $current['task_instance']->doShutdown();
+ $current['task_instance']->accept($this->visitorInstance);
// Remember this task
$tasks[] = $current;