4 Replies Latest reply on Jul 7, 2003 4:42 AM by Sanne de

    NotificationBroadcasterSupport questions

    Ivelin Ivanov Expert

      Looking at the source code I noticed that there are two potential problems:

      1) in sendNotification(), if the listeners map is modified while iterating over the copy, it will cause a NPE
      NotificationListener listener = (NotificationListener)listenerIterator.next();
      Map hbMap = (Map)listenerMap.get(listener);
      Iterator it = hbMap.keySet().iterator();

      2) If one of the listeners throws an exception, then none of the remaining listeners will receive it. Is this required by the spec? As far as I understand JMS will ignore listeners(subs) which throw exceptions, although it will log the error.