0 Replies Latest reply on May 24, 2012 5:27 AM by Daniel Yang

    RF 4.1 Final custom topicListener not work.

    Daniel Yang Novice

      I found that add listener method all types of SessionTopicListener2(SessionTopicListenerWrapper).

       

      In AbstractTopic.java

       public void addTopicListener(TopicListener topicListener) {
      TopicListener listener = topicListener;  
      if (listener instanceof SessionTopicListener) {
      listener = new SessionTopicListenerWrapper((SessionTopicListener) listener);
      }
      listeners.add(listener);
      }
      

       

      and trigger it use this method.

       

          public void publishEvent(TopicEvent event) {
              for (TopicListener listener : listeners) {
                  if (event.isAppropriateListener(listener)) {
                      try {
                          event.invokeListener(listener);
                      } catch (Exception e) {
                          logError(e);
                      }
                  }
              }
          }
      

       

      the method marked blue in SessionTopicEvent.java returns false.

       

          @Override
          public boolean isAppropriateListener(EventListener listener) {
              return (listener instanceof SessionTopicListener);
          }
      

       

      so custom listener not work, maybe "SessionTopicListener"  should be replaced by "SessionTopicListener2". I don't test it.

      Richfaces guys please take a look at this. Thanks.

       

      消息编辑者为:Daniel Yang