public void deleteCurrent ( SITransaction transaction ) throws SISessionUnavailableException , SISessionDroppedException , SIConnectionUnavailableException , SIConnectionDroppedException , SIResourceException , SIConnectionLostException , SILimitExceededException , SIIncorrectCallException , SIMessageNotLockedException , SIErrorException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "deleteCurrent" , transaction ) ; synchronized ( lmeOperationMonitor ) { checkValid ( ) ; // If nextIndex = 0 then we are pointing at the first item, therefore unlocking the current // is invalid. Also, if the message is null, then we must have deleted - therefore also // invalid. if ( ( nextIndex == 0 ) || ( messages [ nextIndex - 1 ] == null ) ) { throw new SIIncorrectCallException ( nls . getFormattedMessage ( "LME_DELETE_INVALID_MSG_SICO1018" , null , null ) ) ; } JsMessage retMsg = messages [ nextIndex - 1 ] ; // Only flow the delete if it would not have been done on the server already. // This will have been done if the message is determined to be 'unrecoverable'. if ( CommsUtils . isRecoverable ( retMsg , consumerSession . getUnrecoverableReliability ( ) ) ) { // Start d181719 JsMessage [ ] msgs = new JsMessage [ ] { retMsg } ; // f191114 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 ( msgs , transaction ) ; // f191114 } } else { deleteMessages ( msgs , null ) ; // f191114 } // End d181719 } // Now remove it from the LME messages [ nextIndex - 1 ] = null ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "deleteCurrent" ) ; }
Deletes the current message .