// Loop through the tasks and execute them...
for (Task task : getTasks()) {
// FIXME: This implementation is a no-op, it just loops through the tasks and fires the TASK_COMPLETE event.
// FIXME: A real implementation would aggregate & dispatch the tasks and register listeners with the "backend dispatcher" which would fire the TASK_COMPLETE event.
// FIXME: This method should not block.
SystemEvent event = new TaskEvent(task);
List<SystemEventListener> listeners = task.getListeners(TaskEvent.TASK_COMPLETE);
if (listeners != null) {
for (SystemEventListener listener : listeners) {
listener.processEvent(event);
}