@ Override public void flush ( int requestNumber ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "flush" , "" + requestNumber ) ; try { // Make sure it is stopped before we activate it if ( mainConsumer . isStarted ( ) ) getConsumerSession ( ) . stop ( ) ; getConsumerSession ( ) . activateAsynchConsumer ( true ) ; if ( mainConsumer . isStarted ( ) ) getConsumerSession ( ) . start ( false ) ; short jfapPriority = JFapChannelConstants . getJFAPPriority ( Integer . valueOf ( mainConsumer . getLowestPriority ( ) ) ) ; // d172528 if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Sending with JFAP priority of " + jfapPriority ) ; // d172528 try { getConversation ( ) . send ( poolManager . allocate ( ) , JFapChannelConstants . SEG_FLUSH_SESS_R , requestNumber , jfapPriority , true , ThrottlingPolicy . BLOCK_THREAD , null ) ; } catch ( SIException e ) { FFDCFilter . processException ( e , CLASS_NAME + ".flush" , CommsConstants . CATASYNCHCONSUMER_FLUSH_01 , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , e . getMessage ( ) , e ) ; SibTr . error ( tc , "COMMUNICATION_ERROR_SICO2017" , e ) ; } } catch ( SIException e ) { //No FFDC code needed //Only FFDC if we haven't received a meTerminated event. if ( ! ( ( ConversationState ) getConversation ( ) . getAttachment ( ) ) . hasMETerminated ( ) ) { FFDCFilter . processException ( e , CLASS_NAME + ".flush" , CommsConstants . CATASYNCHCONSUMER_FLUSH_02 , this ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , e . getMessage ( ) , e ) ; StaticCATHelper . sendExceptionToClient ( e , CommsConstants . CATASYNCHCONSUMER_FLUSH_02 , getConversation ( ) , requestNumber ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "flush" ) ; }
This method will flush the consumer to ensure it is completely out of messages .