question: void recoverMessages ( ) throws RollbackFailedException { if ( m_isQueue ) { if ( _logger . isLoggable ( Level . FINE ) ) { _logger . log ( Level . FINE , "GSSessionImpl.recoverMessages(): Recovering messages of Queue" ) ; } unackedMessages . clear ( ) ; if ( ! isAutoAck ( ) ) { rollbackLocalTransaction ( ) ; } } else { if ( _logger . isLoggable ( Level . FINE ) ) { _logger . log ( Level . FINE , "GSSessionImpl.recoverMessages(): Recovering messages of Topic" ) ; } unackedMessages . addAll ( recoverMessages ) ; LinkedList < MessageQueueElement > temp = unackedMessages ; recoverMessages . clear ( ) ; unackedMessages = recoverMessages ; recoverMessages = temp ; } }
target:  Performs session recovery. With topics, we redeliver the unacked messages that arrived to the session (LOCAL REDELIVERY). With queues, we return the messages to the space so they can be redelivered from there.