public final void cleanupTicks ( StreamInfo sinfo , TransactionCommon t , ArrayList valueTicks ) throws MessageStoreException , SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "cleanupTicks" , new Object [ ] { sinfo , t , valueTicks } ) ; try { int length = valueTicks . size ( ) ; for ( int i = 0 ; i < length ; i ++ ) { AOValue storedTick = ( AOValue ) valueTicks . get ( i ) ; // If we are here then we do not know which consumerDispatcher originally // persistently locked the message. We therefore have to use the meUuid in // the AOValue to find/reconstitute the consumerDispatcher associated with it. This // potentially involves creating AIHs which is not ideal. ConsumerDispatcher cd = null ; if ( storedTick . getSourceMEUuid ( ) == null || storedTick . getSourceMEUuid ( ) . equals ( getMessageProcessor ( ) . getMessagingEngineUuid ( ) ) ) { cd = ( ConsumerDispatcher ) destinationHandler . getLocalPtoPConsumerManager ( ) ; } else { AnycastInputHandler aih = destinationHandler . getAnycastInputHandler ( storedTick . getSourceMEUuid ( ) , null , true ) ; cd = aih . getRCD ( ) ; } SIMPMessage msg = null ; synchronized ( storedTick ) { msg = ( SIMPMessage ) cd . getMessageByValue ( storedTick ) ; if ( msg == null ) { storedTick . setToBeFlushed ( ) ; } } Transaction msTran = mp . resolveAndEnlistMsgStoreTransaction ( t ) ; if ( msg != null && msg . getLockID ( ) == storedTick . getPLockId ( ) ) msg . unlockMsg ( storedTick . getPLockId ( ) , msTran , true ) ; storedTick . lockItemIfAvailable ( controlItemLockID ) ; // should always be successful storedTick . remove ( msTran , controlItemLockID ) ; } } catch ( MessageStoreException e ) { // No FFDC code needed if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "cleanupTicks" , e ) ; throw e ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "cleanupTicks" ) ; }
Helper method called by the AOStream when a persistent tick representing a persistently locked message should be removed since we are flushing or cleaning up state .