private void messageArrived(GSMessageImpl message){
  if (_logger.isLoggable(Level.FINEST)) {
    _logger.log(Level.FINEST,toString2() + "messageArrived(): " + message.JMSMessageID);
  }
synchronized (synchTopicNotifyLock) {
    while (currentMessage != null) {
      if (_logger.isLoggable(Level.FINEST)) {
        _logger.log(Level.FINEST,toString2() + "messageArrived(): A message is already pending: " + currentMessage.JMSMessageID);
      }
      try {
        synchTopicNotifyLock.wait();
      }
 catch (      InterruptedException e) {
        if (m_session.isLocalConsumer(m_consumerID)) {
          if (_logger.isLoggable(Level.SEVERE)) {
            _logger.log(Level.SEVERE,toString2() + "messageArrived(): The notification thread was interrupted. Notification message: " + message.JMSMessageID);
          }
        }
 else {
          if (_logger.isLoggable(Level.INFO)) {
            _logger.log(Level.INFO,toString2() + "messageArrived(): The notification thread is exiting. Notification message: " + message.JMSMessageID);
          }
        }
      }
    }
    currentMessage=message;
    synchTopicNotifyLock.notify();
    while (!m_closed && currentMessage != null) {
      try {
        synchTopicNotifyLock.wait();
      }
 catch (      InterruptedException e) {
        if (m_session.isLocalConsumer(m_consumerID)) {
          if (_logger.isLoggable(Level.SEVERE)) {
            _logger.log(Level.SEVERE,toString2() + "messageArrived(): The notification thread was interrupted while waiting to be released: " + currentMessage.JMSMessageID);
          }
        }
 else {
          if (_logger.isLoggable(Level.INFO)) {
            _logger.log(Level.INFO,toString2() + "messageArrived(): The notification thread is exiting. The consumer is closed. Pending message: " + currentMessage.JMSMessageID);
          }
        }
      }
    }
  }
}

private void messageArrived ( GSMessageImpl message ) { if ( _logger . isLoggable ( Level . FINEST ) ) { _logger . log ( Level . FINEST , toString2 ( ) + "messageArrived(): " + message . JMSMessageID ) ; } synchronized ( synchTopicNotifyLock ) { while ( currentMessage != null ) { if ( _logger . isLoggable ( Level . FINEST ) ) { _logger . log ( Level . FINEST , toString2 ( ) + "messageArrived(): A message is already pending: " + currentMessage . JMSMessageID ) ; } try { synchTopicNotifyLock . wait ( ) ; } catch ( InterruptedException e ) { if ( m_session . isLocalConsumer ( m_consumerID ) ) { if ( _logger . isLoggable ( Level . SEVERE ) ) { _logger . log ( Level . SEVERE , toString2 ( ) + "messageArrived(): The notification thread was interrupted. Notification message: " + message . JMSMessageID ) ; } } else { if ( _logger . isLoggable ( Level . INFO ) ) { _logger . log ( Level . INFO , toString2 ( ) + "messageArrived(): The notification thread is exiting. Notification message: " + message . JMSMessageID ) ; } } } } currentMessage = message ; synchTopicNotifyLock . notify ( ) ; while ( ! m_closed && currentMessage != null ) { try { synchTopicNotifyLock . wait ( ) ; } catch ( InterruptedException e ) { if ( m_session . isLocalConsumer ( m_consumerID ) ) { if ( _logger . isLoggable ( Level . SEVERE ) ) { _logger . log ( Level . SEVERE , toString2 ( ) + "messageArrived(): The notification thread was interrupted while waiting to be released: " + currentMessage . JMSMessageID ) ; } } else { if ( _logger . isLoggable ( Level . INFO ) ) { _logger . log ( Level . INFO , toString2 ( ) + "messageArrived(): The notification thread is exiting. The consumer is closed. Pending message: " + currentMessage . JMSMessageID ) ; } } } } } }
make the next arrived message available to the topic consumer . the thread waits until the message is taken .
