private void waitForInputChannelsToBeClosed ( ) throws IOException , InterruptedException { // Wait for disconnection of all output gates while ( true ) { // Make sure, we leave this method with an InterruptedException when the task has been canceled if ( this . executionObserver . isCanceled ( ) ) { throw new InterruptedException ( ) ; } boolean allClosed = true ; for ( int i = 0 ; i < getNumberOfInputGates ( ) ; i ++ ) { final InputGate < ? extends IOReadableWritable > eig = this . inputGates . get ( i ) ; if ( ! eig . isClosed ( ) ) { allClosed = false ; } } if ( allClosed ) { break ; } else { Thread . sleep ( SLEEPINTERVAL ) ; } } }
Blocks until all input channels are closed .