private void unlockAllUnread ( ) throws SIResourceException , SISessionDroppedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "unlockAllUnread" , new Object [ ] { new Integer ( hashCode ( ) ) , this } ) ; int unlockedMessages = 0 ; synchronized ( this ) { messageAvailable = false ; // Only unlock messages if we have reached the end of the list. if ( firstMsg != null && ! endReached ) { LMEMessage pointerMsg = null ; if ( currentMsg == null ) pointerMsg = firstMsg ; else pointerMsg = currentMsg . next ; LMEMessage removedMsg = null ; boolean more = true ; if ( pointerMsg != null ) { while ( more ) { // See if this is the last message in the list if ( pointerMsg == lastMsg ) more = false ; // Only unlock messages that are in the MS (and haven't already // been unlocked by us) if ( pointerMsg != currentUnlockedMessage ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Unlocking Message " + pointerMsg ) ; if ( pointerMsg . isStored ) { try { unlockMessage ( pointerMsg . message , false ) ; } catch ( SIMPMessageNotLockedException e ) { // No FFDC code needed SibTr . exception ( tc , e ) ; // See defect 387591 // We should only get this exception if the message was deleted via // the controllable objects i.e. the admin console. If we are here for // another reason that we have a real error. } } unlockedMessages ++ ; } removedMsg = pointerMsg ; pointerMsg = pointerMsg . next ; // Remove the element from the list removeMessage ( removedMsg ) ; } } } } if ( unlockedMessages != 0 ) localConsumerPoint . removeActiveMessages ( unlockedMessages ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "unlockAllUnread" , this ) ; }
Method to unlock all messages which haven t been read