ControllerStatus newStatus = ControllerStatus.UNREGISTERING;
controller.setControllerStatus(newStatus);
Group group = controller.getGroup();
group.fireListeners(controller, newStatus);
Context context = controller.getContext();
context.fireListeners(controller, newStatus);
fireListeners(controller, newStatus);
}
// cancel all tasks
if (cancelGroupTaskExecution) {
for (Controller controller : freeList) {
controller.getGroup().cancelTasks();
}
}
// unregister all
for (Controller controller : freeList) {
Application.getMessageManager().unregister(controller);
Group group = controller.getGroup();
group.unregister(controller);
if (group.count() == 0) {
group.shutdown();
}
Context context = controller.getContext();
context.unregister(controller);
Controller parentController = controller.getParent();
if (parentController != null) {
controller.unregisterParent();
parentController.unregisterChild(controller);