@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;
}

@ 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 ; }
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 .
