code: public void process(final boolean asynch)
            throws NotificationException {
      if (asynch) {
        try {
          consumer.setMessageListener(this);
          return;
        } catch (final JMSException je) {
          throw new NotificationException(je);
        }
      }
  
      while (running) {
        final Message m = conn.receive();
  
        if (m == null) {
          running = false;
          return;
        }
        onMessage(m);
      }
    }
docs: For asynch we do the onMessage listener style. Otherwise we wait
  synchronously for incoming messages.
  
  @param asynch true if we just want to set the listener
  @throws NotificationException