public void deleteSeen ( SITransaction transaction ) throws SISessionUnavailableException , SISessionDroppedException , SIConnectionUnavailableException , SIConnectionDroppedException , SIResourceException , SIConnectionLostException , SILimitExceededException , SIIncorrectCallException , SIMessageNotLockedException , SIErrorException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "deleteSeen" , transaction ) ; synchronized ( lmeOperationMonitor ) { checkValid ( ) ; // If we have seen any messages.... int numSeenMsgs = getSeenMessageCount ( ) ; if ( numSeenMsgs > 0 ) { // Start d181719 JsMessage [ ] seenRecoverableMessages = new JsMessage [ numSeenMsgs ] ; int numOfMessagesNeedingDeleting = 0 ; // Go through each seen message for ( int i = 0 ; i < nextIndex ; ++ i ) { if ( messages [ i ] != null ) { // Only add the message to the list of messages to delete if it is recoverable if ( CommsUtils . isRecoverable ( messages [ i ] , consumerSession . getUnrecoverableReliability ( ) ) ) // f177889 { // f177889 seenRecoverableMessages [ numOfMessagesNeedingDeleting ] = messages [ i ] ; // f177889 ++ numOfMessagesNeedingDeleting ; } // f177889 // Delete it from the main pile messages [ i ] = null ; } } if ( numOfMessagesNeedingDeleting > 0 ) { if ( transaction != null ) { synchronized ( transaction ) { // Check transaction is in a valid state. // Enlisted for an XA UOW and not rolledback or // completed for a local transaction. if ( ! ( ( Transaction ) transaction ) . isValid ( ) ) { throw new SIIncorrectCallException ( nls . getFormattedMessage ( "TRANSACTION_COMPLETE_SICO1022" , null , null ) ) ; } deleteMessages ( seenRecoverableMessages , transaction ) ; } } else { deleteMessages ( seenRecoverableMessages , null ) ; } } // End d181719 } // End f191114 } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "deleteSeen" ) ; }
Deletes all messages seen so far .