protected void unlockAll ( boolean closingSession ) throws SIResourceException , SIMPMessageNotLockedException , SISessionDroppedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "unlockAll" , new Object [ ] { new Integer ( hashCode ( ) ) , this } ) ; int unlockedMessages = 0 ; SIMPMessageNotLockedException notLockedException = null ; int notLockedExceptionMessageIndex = 0 ; synchronized ( this ) { messageAvailable = false ; if ( firstMsg != null ) { LMEMessage pointerMsg = firstMsg ; LMEMessage removedMsg = null ; SIMessageHandle [ ] messageHandles = new SIMessageHandle [ getNumberOfLockedMessages ( ) ] ; boolean more = true ; 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 ( pointerMsg . isStored ) { try { unlockMessage ( pointerMsg . message , true ) ; } 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. SibTr . error ( tc , "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.impl.AbstractLockedMessageEnumeration" , "1:2229:1.154.3.1" , e } ) ; messageHandles [ notLockedExceptionMessageIndex ] = pointerMsg . getJsMessage ( ) . getMessageHandle ( ) ; notLockedExceptionMessageIndex ++ ; if ( notLockedException == null ) notLockedException = e ; } catch ( SISessionDroppedException e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.AbstractLockedMessageEnumeration.unlockAll" , "1:2243:1.154.3.1" , this ) ; if ( ! closingSession ) { handleSessionDroppedException ( e ) ; } SibTr . exception ( tc , e ) ; SibTr . error ( tc , "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.impl.AbstractLockedMessageEnumeration.unlockAll" , "1:2255:1.154.3.1" , e } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "unlockAll" , e ) ; throw e ; } } unlockedMessages ++ ; } removedMsg = pointerMsg ; pointerMsg = pointerMsg . next ; // Remove the element from the list removeMessage ( removedMsg ) ; } currentUnlockedMessage = null ; } } if ( unlockedMessages != 0 ) localConsumerPoint . removeActiveMessages ( unlockedMessages ) ; if ( notLockedException != null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "unlockAll" , this ) ; throw notLockedException ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "unlockAll" , this ) ; }
Unlock all the messages in the list