private void processInstanceContentEvent ( InstancesContentEvent instContentEvent ) { this . numBatches ++ ; this . contentEventList . add ( instContentEvent ) ; if ( this . numBatches == 1 || this . numBatches > 4 ) { this . processInstances ( this . contentEventList . remove ( 0 ) ) ; } if ( instContentEvent . isLastEvent ( ) ) { // drain remaining instances while ( ! contentEventList . isEmpty ( ) ) { processInstances ( contentEventList . remove ( 0 ) ) ; } } }
Helper method to process the InstanceContentEvent