@Override public final void setInterrupt(boolean flag) { this.termination_ = flag; super.setInterrupt(flag); inputProcessorFactory_.setInterrupt(flag); }
/** * Marks the end of the input and requests all workers to terminate when all * currently submitted input has been processed. After calling this method, * no new input can be submitted anymore, i.e., calling * {@link #submit(Object)} will always return {@code false}. The method * blocks until all workers have been stopped. If interrupted while blocked, * this method can be called again in order to complete the termination * request. * * @throws InterruptedException * if interrupted during waiting for finish request */ public synchronized void finish() throws InterruptedException { termination_ = true; waitWorkers(); if (!isInterrupted()) { termination_ = false; inputProcessorFactory_.finish(); } }