{
try
{
logger.debug("[run] Starting BackgroundMailCheck.");
// start a mail check, and stick it on the session
BackgroundMailCheck currentDaemon = (BackgroundMailCheck)session.getAttribute("mailDaemon");
if (currentDaemon == null || !currentDaemon.isAlive())
{
logger.debug("[run] No current living Daemon, start another.");
BackgroundMailCheck mailDaemon = new BackgroundMailCheck("mailDaemon" + individualId, individualId, this.dataSource);
mailDaemon.setDaemon(true);
mailDaemon.start();
session.setAttribute("mailDaemon", mailDaemon);
}
} catch(IllegalStateException ise) {
// kill this job because the session is not
// valid, so the user must not be logged in