@Override public void process() throws InterruptedException { for (;;) { if (isInterrupted()) { break; } J nextJob = jobsToDo_.poll(); if (nextJob == null) { break; } process(nextJob); if (listener_ != null) { listener_.notifyFinished(nextJob); } } }