@Override
public void run() {
while (running) {
executionQueue = new ArrayDeque<Connector>(scheduledConnectors);
while (!executionQueue.isEmpty() && running) {
Connector c = executionQueue.remove();
int retreived = c.checkNewMessages();
logger.info("Processed {} messages using \"{}\" connector.", retreived, c.toString());
}
try {
TimeUnit.SECONDS.sleep(SLEEP_TIME_BETWEEN_NEW_MAIL_CHECKS);
} catch (InterruptedException e) {
running = false;