code: def on_message(self, headers, message):
          
  
          with self._handover_cond:
  
              # Wait until receiver has processed the previous notification
              while len(self._handover_dict) > 0:
                  self._handover_cond.wait(self._wait_timeout)
  
              # Indicate to receiver that there is a new notification
              self._handover_dict['headers'] = headers
              try:
                  msg_obj = json.loads(message)
              except Exception:
                  raise  # TODO: Find better exception for this case
              self._handover_dict['message'] = msg_obj
              self._handover_cond.notifyAll()
docs: Event method that gets called when this listener has received a JMS
          message (representing an HMC notification).
  
          Parameters:
  
            headers (dict): JMS message headers, as described for `headers` tuple
              item returned by the
              :meth:`~zhmcclient.NotificationReceiver.notifications` method.
  
            message (string): JMS message body as a string, which contains a
              serialized JSON object. The JSON object is described in the
              `message` tuple item returned by the
              :meth:`~zhmcclient.NotificationReceiver.notifications` method).