| Manages all tasks which are responsible for doing clean-up work when shutting
down Columba.
This includes saving the xml configuration, saving folder data, etc.
Tasks use register to the managers shutdown queue.
When shutting down Columba, the tasks will be running in the opposite order
the have registered at.
Currently this is the following:
- addressbook folders header cache
- POP3 header cache
- email folders header cache
- core tasks (no core tasks used currently)!
Note, that I used the opposite ordering to make sure that core tasks are
executed first. But, currently there are no core tasks available which would
demand this behaviour.
Saving email folder header cache is running as a
Command . Its
therefore a background thread, where we don't know when its finished. This is
the reason why we use
MainInterface.processor.getTaskManager().count() to check if
no more commands are running.
Finally, note that the
ColumbaServer is stopped first, then the
background manager, afterwards all registered shutdown tasks and finally the
xml configuration is saved. Note, that the xml configuration has to be saved
after the email folders where saved.
author: fdietz |