@ Override public void readAndDeleteSet ( int requestNumber , SIMessageHandle [ ] msgHandles , int tran ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "readAndDeleteSet" , new Object [ ] { requestNumber , msgHandles , tran } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Request to read / delete " + msgHandles . length + " message(s)" ) ; final ConversationState convState = ( ConversationState ) getConversation ( ) . getAttachment ( ) ; try { SITransaction siTran = null ; if ( tran != CommsConstants . NO_TRANSACTION ) { siTran = ( ( ServerLinkLevelState ) getConversation ( ) . getLinkLevelAttachment ( ) ) . getTransactionTable ( ) . get ( tran ) ; } SIBusMessage [ ] messages ; if ( siTran != IdToTransactionTable . INVALID_TRANSACTION ) { messages = bifSession . readAndDeleteSet ( msgHandles , siTran ) ; } else { messages = new SIBusMessage [ 0 ] ; } // Add the number of items first CommsServerByteBuffer buff = poolManager . allocate ( ) ; buff . putInt ( messages . length ) ; for ( int x = 0 ; x < messages . length ; x ++ ) { buff . putMessage ( ( JsMessage ) messages [ x ] , convState . getCommsConnection ( ) , getConversation ( ) ) ; } try { getConversation ( ) . send ( buff , JFapChannelConstants . SEG_READ_AND_DELETE_SET_R , requestNumber , JFapChannelConstants . PRIORITY_MEDIUM , true , ThrottlingPolicy . BLOCK_THREAD , null ) ; } catch ( SIException e ) { FFDCFilter . processException ( e , CLASS_NAME + ".readAndDeleteSet" , CommsConstants . CATBIFCONSUMER_READANDDELTESET_01 , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , e . getMessage ( ) , e ) ; SibTr . error ( tc , "COMMUNICATION_ERROR_SICO2033" , e ) ; } } catch ( Exception e ) { //No FFDC code needed //Only FFDC if we haven't received a meTerminated event OR if this Exception isn't a SIException. if ( ! ( e instanceof SIException ) || ! convState . hasMETerminated ( ) ) { FFDCFilter . processException ( e , CLASS_NAME + ".readAndDeleteSet" , CommsConstants . CATBIFCONSUMER_READANDDELTESET_02 , this ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , e . getMessage ( ) , e ) ; StaticCATHelper . sendExceptionToClient ( e , CommsConstants . CATBIFCONSUMER_READANDDELTESET_02 , getConversation ( ) , requestNumber ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "readAndDeleteSet" ) ; }
This method will return and delete a set of messages currently locked by the messaging engine .