protected Executable getJobImpl() throws InterruptedException { while (m_heap.peek() == null) { wait(); } TimerTask task = (TimerTask)m_heap.extract(); switch (task.getState()) { case TimerTask.CANCELLED: case TimerTask.EXECUTED: //don't hold onto last dead task if we wait. task = null; return getJobImpl(); case TimerTask.NEW: case TimerTask.SCHEDULED: return task; default: throw new IllegalStateException("TimerTask has an illegal state"); } } protected Runnable createQueueLoop()