question: @ Override public final boolean hasNext ( ) throws IOException , CollectionException { while ( ! shuttingDown ) { monitor . startFunctionTrace ( "hasNext" ) ; boolean next = doHasNext ( ) ; monitor . finishFunctionTrace ( "hasNext" ) ; if ( next ) { return true ; } try { Thread . sleep ( sleepDelay ) ; } catch ( InterruptedException e ) { shutdown ( ) ; } } return false ; }
target:  Override of the UIMA hasNext() method with logic to continuously check for new documents until one is found. This prevents the collection reader from exiting (unless asked to), and so creates a persistent collection reader and pipeline.