public void clear ( ) { boolean done = false ; while ( ! done ) { ReceiveMessageBatchTask currentBatch = null ; synchronized ( finishedTasks ) { currentBatch = finishedTasks . poll ( ) ; } if ( currentBatch != null ) { currentBatch . clear ( ) ; } else { // ran out of batches to clear done = true ; } } }
Clears and nacks any pre - fetched messages in this buffer .