/** * Called by this class, this method checks if the queue is empty; * if it is, then waits, else returns the current job. * * @see #putJob * @return the executable * @throws InterruptedException */ protected synchronized Executable getJob() throws InterruptedException { // Preconditions if (m_queueThread == null || !m_queueThread.isAlive()) { throw new IllegalStateException(); } return getJobImpl(); }